Azure APIM Fails to Create API from Function App

Viewed 3237

When I try to create an API in APIM by using Create from Function App, I fill out the fields and click Create. The operation provides the wait dots and comes back in five seconds and says

Could not create an API. Please try again later.

I can create a blank API...but not one from an existing Function App. I have tried multiple combinations, No products, all products, no version, version..etc. No luck.

Thoughts?


enter image description here


Notes

  • The function in question is an HTTP Trigger.
  • The function works locally on my development box and in Azure.
  • APIM Tier is Developer
  • On that Function app, during Publish in Visual Studio I have reported that attempting to manage application settings before a publish fails and in trying to add a new one causes Visual Studio to unexpectedly close. Manage Application Settings on Publish Related, don't know.
7 Answers

Just a Ctrl + F5 solved the problem for me. Try it! ;)

I just ran into the same issue because I used Linux (Preview) instead of Windows. When I blew away the Function App and recreated a new one with Windows, my API Manager was able to create an API off it.

I have reproduce the same scenario. It is working for me. May I know, below details, 01.Hope you have tested your function and it is working fine. 02.What is the type of the function ? Hope that is "Http trigger" ? 03.What is you APIM tier ? (eg : development, basic etc.)

At this time the solution for me was to use Microsoft Edge instead of Chrome.

It seems Microsoft Azure portal is not working properly in Chrome and I noticed issues in several places. Parts of pages are not rendered at all and sometimes even errors like this pop up just because of the browser.

I had this same problem.
The fix was both simple and unexpected.

When importing the function app, simply enter "/" in the API URL Suffix field. For me this changed the BaseURL field value. Originally it was just the host, ie http://hostname/. It then appended the endpoint the hostname, http://hostname/endpoint This is done on the "Create Function from App" modal.

Click for screenshot

I had the same problem when trying to publish my Azure Functions application with several HTTP triggered functions through API Management running on Consumption plan. The plan did not have anything to do with the problem though.

What I did not realize was that my function app was not working properly when browsing it from the Azure portal. I had some configuration errors that prevented the app to work properly. When I resolved those, I succeeded to publish the application through APIM.

So, check that your application is working properly by browsing to it if you run into the problem described in this thread.

2022 answer My problem was that the function did not actually work. The "Browse" button that redirects to the page with the light bulb and the text "Your function app version X is up and running" did show, but the function still didn't work.

This had to be fixed before the error when importing to the APIM was gone.

Related