Reputation: 23
I've created two .NET core (standard 2.0) Function Apps in Visual Studio and deployed them to Azure and successfully consumed them from Logic Apps. Although I had to pass all my parameters in the body as I couldn't create a swagger definition (API definition gives the message - Function API definition (Swagger) feature is not supported for beta runtime currently.)
This week however when I try to use a new function app in a new logic app I get a message –
Failed to fetch swagger with error message: Unable to get https://functionAppName.azurewebsites.net/admin/host/swagger?code=Zmjahr48TCU32BbwBgQ8Q7XG66sXzyDbV4A6ZBK230W08MBy6mkmUg==. Ensure you have CORS enabled on the endpoint and are calling a valid HTTPS endpoint.
I could see in dev tools that the preflight request was failing so I tried a fix whereby I removed all the Allowed Origins in the CORS definition for the function App. Saved and added an entry for * (then save and restart app). After doing this I get a new error -
Failed to fetch swagger with error message: Failed to fetch. Ensure you have CORS enabled on the endpoint and are calling a valid HTTPS endpoint.
In dev tools I see it’s getting a 404 not found on the swagger definition.
So I removed the FUNCTIONS_EXTENSION_VERSION
beta and created an API definition and now I can add it as an action in my Logic App but I can’t invoke it as I get the error:
"message": "'MethodName' can't be invoked from Azure WebJobs SDK. Is it missing Azure WebJobs SDK attributes?"
In the meantime the initial Function Apps I created in the same subscription are still working (even after republishing from VS). The new function apps work successfully in the test window and when called via postman, so the apps themselves are fine. It's just the definition that's not working which stops me adding them as an action in a Logic App
What's going wrong with the new Function Apps and how can the original ones still be working?
Upvotes: 1
Views: 1298
Reputation: 2094
You should add this to CORS in your Azure functions settings
https://ema.hosting.portal.azure.net
Upvotes: 1