Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
APPLIES TO: All API Management tiers
Azure API Management supports importing Azure Function Apps as new APIs or appending them to existing APIs. The process automatically generates a host key in the Azure Function App, which is then assigned to a named value in Azure API Management.
Note
Currently, this feature isn't available in workspaces.
This article walks through importing and testing an Azure Function App as an API in Azure API Management.
You will learn how to:
Note
You can use the API Management Extension for Visual Studio Code to import and manage your APIs. Follow the API Management Extension tutorial to install and get started.
In the Azure portal, search for and select API Management services.
On the API Management services page, select your API Management instance.
Follow the steps below to create a new API from an Azure Function App.
Navigate to your API Management service in the Azure portal and select APIs from the menu.
In the Add a new API list, select Function App.
Click Browse to select Functions for import.
Click on the Function App section to choose from the list of available Function Apps.
Find the Function App you want to import Functions from, click on it and press Select.
Select the Functions you would like to import and click Select.
Switch to the Full view and assign Product to your new API.
If needed, specify other fields during creation or configure them later via the Settings tab.
Note
Products are associations of one or more APIs offered to developers through the developer portal. First, developers must subscribe to a product to get access to the API. Once subscribed, they get a subscription key for any API in that product. As creator of the API Management instance, you are an administrator and are subscribed to every product by default.
Each API Management instance comes with two default sample products:
Click Create.
Follow the steps below to append Azure Function App to an existing API.
In your Azure API Management service instance, select APIs from the menu on the left.
Choose an API you want to import an Azure Function App to. Click ... and select Import from the context menu.
Click on the Function App tile.
In the pop-up window, click Browse.
Click on the Function App section to choose from the list of available Function Apps.
Find the Function App you want to import Functions from, click on it and press Select.
Select the Functions you would like to import and click Select.
Click Import.
Import of an Azure Function App automatically generates:
For APIs created after April 4th 2019, the host key is passed in HTTP requests from API Management to the Function App in a header. Older APIs pass the host key as a query parameter. You can change this behavior through the PATCH Backend
REST API call on the Backend entity associated with the Function App.
Warning
Removing or changing either the Azure Function App host key value or the Azure API Management named value will break the communication between the services. The values do not sync automatically.
If you need to rotate the host key, make sure the named value in Azure API Management is also modified.
Navigate to your Azure Function App instance.
In the Functions section of the side navigation menu, select App keys.
Find the keys under the Host keys section.
Navigate to your Azure API Management instance and select Named values from the menu on the left. The Azure Function App key is stored there.
You can call operations directly from the Azure portal. Using the Azure portal is a convenient way to view and test the operations of an API.
Select the API that you created in the preceding section.
Select the Test tab.
Select the operation you want to test.
Select Send.
Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Expose multiple Azure Function apps as a consistent API by using Azure API Management - Training
In this module, you learn how to assemble multiple Azure Functions into a single API using Azure API Management.
Certification
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.