Hi Bob Feller,
Thanks for reaching out Microsoft Q&A!
Thanks for sharing details. I understand you're trying to fetch swagger definition in an HTTP Swagger action and getting error "Failed to fetch"
1.Ensure that the URL you are using for your Swagger definition is correct and accessible. Since you can access it through the browser, this seems to be okay.
2.If your Swagger/OpenAPI file is hosted on a different domain (e.g., Azure Blob Storage or any external web service), it's important to ensure that Cross-Origin Resource Sharing (CORS) is correctly configured. Without proper CORS settings, the Logic Apps Designer (which runs in the browser) will not be able to fetch the Swagger definition resulting in the “Failed to fetch” error.
In the Azure portal, navigate to your storage account.
- Under Settings, select CORS.
- Add a rule with * as the Allowed Origins, and include GET as an Allowed Method
3.Ensure that there are no firewall rules or network restrictions preventing Logic Apps from accessing your Swagger file.
4.The HTTP + Swagger built-in operations currently support only OpenAPI 2.0, not OpenAPI 3.0.
- To work around this, I suggest switching to the standard HTTP action instead, which allows you to manually configure the API call without depending on a Swagger definition.
- To test this behavior, I created a sample Logic App that fetch swagger definition, and it works fine for me. The Logic App uses the following steps:
- Use the HTTP action to fetch swagger definition
This may help you identify if the issue lies specifically with the HTTP + Swagger action.
You can also refer the documentation regarding any queries related to http swagger -
https://learn.microsoft.com/en-us/azure/connectors/connectors-native-http-swagger
If none of the above suggestions resolve your issue, could you please share a few more details to help narrow it down? Here are some follow-up questions that might help us better understand the problem:
- Where is your Swagger file hosted?
- Is the Swagger definition publicly accessible, or does it require authentication?
- What is the format and version of the Swagger file you're using?
- Do you see any specific error messages in the developer console when trying to fetch the Swagger?
I hope this helps you resolve the issue! If you continue to experience problems or have additional details to share, please feel free to post them here- I'd be happy to assist further.