Error creating API from Azure Function

Rafael Schimidt Ragazzo 0 Reputation points
2023-06-02T03:47:47.29+00:00

I have created an Azure Function App which currently has only one function set with HTTP trigger and Function Authorization Level. It's running on Windows and runtime is .NET 6 LTS (Isolated).

I've created an API Management Service and now I'm trying to expose the function on the APIM instance. I've tried two ways:

  1. Going into the APIM service, APIs blade and Creating from Azure Resource (Function App). I'm able to select the function from the list, but when I click on Create I just get a popup with the message: Could not create an API, please try again later. I've seen in Stack Overflow threads and other MS question about doing a hard refresh (CTRL + F5) but this doesn't work on my case. Also tested other browsers (Chrome, Edge) with the same result.

User's image

  1. I also attempted to create it via the Function App, going in the API blade and clicking on API Management. I can select the APIM instance from the list, then I'm selecting "Create New" on the API dropdown, then I'm clicking it on the "Link API", I can see the the single function showing up on the list, but when I click on the Select button I'm getting the following message: The request did not have a subscription or a valid tenant level resource provider. (Code: MissingSubscription).

User's image

I ran out of options to understand what is the problem, so can someone please help me in understanding what's wrong?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,779 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,314 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 17,355 Reputation points Microsoft Employee
    2023-06-08T06:27:40.4533333+00:00

    @Rafael Schimidt Ragazzo Thanks for getting back. I tried this again from the Azure APIM Portal and I am able to import the Function APP from the APIM and see ALL the Operations successfully.

    I am sending you the step by step approach if that helps.

    1. Navigate to your APIM resource and click on Add API and Select Function APP

    User's image

    1. Click on the Full Button and then Click on Browse:
      User's image
    2. Note: Azure API Management requires Azure Functions to use the HTTP trigger and Function or Anonymous authorization level setting. Select your function APP and Click on Select button:

    User's image

    1. Associate this API with right Product (Starter / unlimited). Add the right API URI Suffix as shown below:

    User's image

    1. You should be able to see the Operations getting imported:

    User's image

    Please let me know if the above steps help.

    On a side note, if you want to automate your approach of importing multiple Function Apps to APIM programmatically, you can follow the below article:

    https://techcommunity.microsoft.com/t5/azure-paas-blog/import-azure-function-app-to-azure-api-management/ba-p/2594810

    If you have any follow-up questions, Please let me know. I would be happy to help.