16

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.
ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122

8 Answers8

20

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

Marcelo Luz
  • 500
  • 4
  • 7
  • 1
    Didn't expect this to actually work, but lo and behold it surprisingly did. This also worked for me with a different error than the OP in case someone comes here like I did searching for a solution. The error in my case was related to not being able to get the config data from my function app. – Architekt May 26 '21 at 16:08
  • Also worked for me when I had this issue too! – Matthew Jones Nov 15 '21 at 23:47
  • Worked for me too! – Aiden Dipple Aug 08 '23 at 03:09
2

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.

westandy
  • 1,360
  • 2
  • 16
  • 41
1

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.)

Inzi
  • 348
  • 3
  • 12
  • Hope you have follwed below link. Kindly check the note, You can import only Functions that are based off HTTP trigger and have the authorization level setting set to Anonymous or Function. https://learn.microsoft.com/en-us/azure/api-management/import-function-app-as-api – Inzi Jan 18 '19 at 06:01
1

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.

Cristian
  • 56
  • 4
  • I've seen similar with other Azure tools, where one would have to switch browsers. That is why one never deletes the copy of `Mozilla` they have. – ΩmegaMan Mar 16 '21 at 19:44
1

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

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
JustinH
  • 11
  • 1
1

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.

Mika Berglund
  • 61
  • 1
  • 4
1

The issue 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.

The function error had to be fixed before when importing to the APIM was done.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
1

I had temporarily suspended (or stopped) my Function App. Restarting it resolved the problem.

I hope Azure could improve the error message, at least from UX perspective.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
jkim
  • 152
  • 1
  • 3
  • 15