Skip to content

Commit 742e9a1

Browse files
committed
edits
1 parent c12c305 commit 742e9a1

File tree

1 file changed

+69
-71
lines changed

1 file changed

+69
-71
lines changed
Lines changed: 69 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +1,167 @@
11
---
2-
title: Import an Azure Function App as an API in API Management
2+
title: Import an Azure function app as an API in API Management
33
titleSuffix: Azure API Management
4-
description: This article shows you how to import an Azure Function App into Azure API Management as an API.
4+
description: Learn how to import an Azure function app into Azure API Management as an API.
55
services: api-management
66
author: dlepow
77
ms.service: azure-api-management
88
ms.topic: how-to
99
ms.date: 03/28/2025
1010
ms.author: danlep
11+
12+
#customer intent: As an API developer, I want to import an Azure function app as an API in API Management.
1113
---
1214

13-
# Import an Azure Function App as an API in Azure API Management
15+
# Import an Azure function app as an API in Azure API Management
1416

1517
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1618

17-
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.
19+
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 API Management.
1820

1921
[!INCLUDE [api-management-workspace-availability](../../includes/api-management-workspace-availability.md)]
2022

21-
This article walks through importing and testing an Azure Function App as an API in Azure API Management.
23+
This article describes how to import an Azure function app as an API to Azure API Management and test the API.
2224

23-
You will learn how to:
25+
You'll learn how to:
2426

2527
> [!div class="checklist"]
26-
> * Import an Azure Function App as an API
27-
> * Append an Azure Function App to an API
28-
> * View the new Azure Function App host key and Azure API Management named value
28+
> * Import an Azure function app as an API
29+
> * Append an Azure function app to an API
30+
> * View the new function app host key and API Management named value
2931
> * Test the API in the Azure portal
3032
3133
## Prerequisites
3234

3335
* Complete the [Create an Azure API Management instance](get-started-create-service-instance.md) quickstart.
34-
* Make sure you have an Azure Functions app in your subscription. For more information, see [Create an Azure Function App](../azure-functions/functions-get-started.md). Functions must have HTTP trigger and authorization level set to *Anonymous* or *Function*.
36+
* Make sure you have an Azure function app in your subscription. For more information, see [Create an Azure Function App](../azure-functions/functions-get-started.md). Functions must have an HTTP trigger. The authorization level must be set to *Anonymous* or *Function*.
3537

3638
> [!NOTE]
37-
> You can use the API Management Extension for Visual Studio Code to import and manage your APIs. Follow the [API Management Extension tutorial](visual-studio-code-tutorial.md) to install and get started.
38-
39-
[!INCLUDE [api-management-navigate-to-instance.md](../../includes/api-management-navigate-to-instance.md)]
39+
> You can use the API Management Extension for Visual Studio Code to import and manage your APIs. Complete the [API Management Extension tutorial](visual-studio-code-tutorial.md) to get started.
4040
41-
## <a name="add-new-api-from-azure-function-app"></a> Import an Azure Function App as a new API
41+
## <a name="add-new-api-from-azure-function-app"></a> Import an Azure function app as a new API
4242

43-
Follow the steps below to create a new API from an Azure Function App.
43+
To create a new API from an Azure function app:
4444

45-
1. Navigate to your API Management service in the Azure portal and select **APIs** from the menu.
45+
1. Navigate to your API Management service in the Azure portal, and then select **APIs** in the left pane.
4646

47-
2. In the **Add a new API** list, select **Function App**.
47+
1. Under **Create from Azure resource**, select **Function App**:
4848

4949
:::image type="content" source="./media/import-function-app-as-api/add-01.png" alt-text="Screenshot that shows the Function App tile.":::
5050

51-
3. Click **Browse** to select Functions for import.
51+
1. Select the **Browse** button.
5252

53-
:::image type="content" source="./media/import-function-app-as-api/add-02.png" alt-text="Screenshot that highlights the Browse button.":::
53+
:::image type="content" source="./media/import-function-app-as-api/add-02.png" alt-text="Screenshot that shows the Browse button." lightbox="./media/import-function-app-as-api/add-02.png":::
5454

55-
4. Click on the **Function App** section to choose from the list of available Function Apps.
55+
1. Select the **Function App** section to choose from the list of available function apps:
5656

57-
:::image type="content" source="./media/import-function-app-as-api/add-03.png" alt-text="Screenshot that highlights the Function App section.":::
57+
:::image type="content" source="./media/import-function-app-as-api/add-03.png" alt-text="Screenshot that shows the Function App section." lightbox="./media/import-function-app-as-api/add-03.png":::
5858

59-
5. Find the Function App you want to import Functions from, click on it and press **Select**.
59+
1. Find the function app that you want to import functions from, select it, and then click **Select**:
6060

61-
:::image type="content" source="./media/import-function-app-as-api/add-04.png" alt-text="Screenshot that highlights the Function App you want to import Functions from and the Select button.":::
61+
:::image type="content" source="./media/import-function-app-as-api/add-04.png" alt-text="Screenshot that shows a function app and the Select button." lightbox="./media/import-function-app-as-api/add-04.png":::
6262

63-
6. Select the Functions you would like to import and click **Select**.
64-
* You can only import Functions based off HTTP trigger with *Anonymous* or *Function* authorization levels.
63+
1. Select the functions that you want to import and click **Select**. You can only import functions that have an HTTP trigger and an *Anonymous* or *Function* authorization level.
6564

66-
:::image type="content" source="./media/import-function-app-as-api/add-05.png" alt-text="Screenshot that highlights the Functions to import and the Select button.":::
65+
:::image type="content" source="./media/import-function-app-as-api/add-05.png" alt-text="Screenshot that shows a function and the Select button." lightbox="./media/import-function-app-as-api/add-05.png":::
6766

68-
7. Switch to the **Full** view and assign **Product** to your new API.
69-
8. If needed, specify other fields during creation or configure them later via the **Settings** tab.
70-
* The settings are explained in the [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api) tutorial.
67+
1. Switch to the **Full** view and assign a **Product** to your new API.
68+
1. As needed, specify other settings. You can also specify settings later via the **Settings** tab. These settings are explained in the [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api) tutorial.
7169

7270
>[!NOTE]
73-
> 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.
71+
> *Products* are associations of one or more APIs that are offered to developers via the Developer Portal. First, developers must subscribe to a product to get access to the API. When they subscribe, they get a subscription key for any API in the product. If you created the API Management instance, you're an administrator and are subscribed to every product by default.
7472
>
7573
> Each API Management instance comes with two default sample products:
7674
> - **Starter**
7775
> - **Unlimited**
7876
79-
9. Click **Create**.
77+
1. Select **Create**.
8078

81-
## <a name="append-azure-function-app-to-api"></a> Append Azure Function App to an existing API
79+
## <a name="append-azure-function-app-to-api"></a> Append a function app to an existing API
8280

83-
Follow the steps below to append Azure Function App to an existing API.
81+
To append a function app to an existing API:
8482

85-
1. In your **Azure API Management** service instance, select **APIs** from the menu on the left.
83+
1. In your **Azure API Management** service instance, select **APIs** in the left pane.
8684

87-
2. Choose an API you want to import an Azure Function App to. Click **...** and select **Import** from the context menu.
85+
1. Choose an API that you want to import a function app to. Select the ellipsis (**...**), and then select **Import**:
8886

89-
:::image type="content" source="./media/import-function-app-as-api/append-function-api-1.png" alt-text="Screenshot that highlights the Import menu option.":::
87+
:::image type="content" source="./media/import-function-app-as-api/append-function-api-1.png" alt-text="Screenshot that shows the Import menu option." lightbox="./media/import-function-app-as-api/append-function-api-1.png":::
9088

91-
3. Click on the **Function App** tile.
89+
1. Select the **Function App** tile:
9290

93-
:::image type="content" source="./media/import-function-app-as-api/append-function-api-2.png" alt-text="Screenshot that highlights the Function App tile.":::
91+
:::image type="content" source="./media/import-function-app-as-api/append-function-api-2.png" alt-text="Screenshot that shows the Function App tile." lightbox="./media/import-function-app-as-api/append-function-api-2.png":::
9492

95-
4. In the pop-up window, click **Browse**.
93+
1. In the **Import from Function App window**, select **Browse**:
9694

97-
:::image type="content" source="./media/import-function-app-as-api/append-function-api-3.png" alt-text="Screenshot that shows the Browse button.":::
95+
:::image type="content" source="./media/import-function-app-as-api/append-function-api-3.png" alt-text="Screenshot that shows the Browse button." lightbox="./media/import-function-app-as-api/append-function-api-3.png":::
9896

99-
5. Click on the **Function App** section to choose from the list of available Function Apps.
97+
1. Select the **Function App** section to choose from a list of available function apps:
10098

101-
:::image type="content" source="./media/import-function-app-as-api/add-03.png" alt-text="Screenshot that highlights the list of Function Apps.":::
99+
:::image type="content" source="./media/import-function-app-as-api/add-03.png" alt-text="Screenshot that shows the Function App section." lightbox="./media/import-function-app-as-api/add-03.png":::
102100

103-
6. Find the Function App you want to import Functions from, click on it and press **Select**.
101+
1. Find the function app you want to import functions from, select it, and then click **Select**:
104102

105-
:::image type="content" source="./media/import-function-app-as-api/add-04.png" alt-text="Screenshot that highlights the Function App you want to import functions from.":::
103+
:::image type="content" source="./media/import-function-app-as-api/add-04.png" alt-text="Screenshot that shows the function app and the Select button." lightbox="./media/import-function-app-as-api/add-04.png":::
106104

107-
7. Select the Functions you would like to import and click **Select**.
105+
1. Select the functions that you want to import, and then click **Select**:
108106

109-
:::image type="content" source="./media/import-function-app-as-api/add-05.png" alt-text="Screenshot that highlights the functions you'd like to import.":::
107+
:::image type="content" source="./media/import-function-app-as-api/add-05.png" alt-text="Screenshot that shows the list of functions." lightbox="./media/import-function-app-as-api/add-05.png":::
110108

111-
8. Click **Import**.
109+
1. Select **Import**:
112110

113-
:::image type="content" source="./media/import-function-app-as-api/append-function-api-4.png" alt-text="Append from Function App":::
111+
:::image type="content" source="./media/import-function-app-as-api/append-function-api-4.png" alt-text="Screenshot that shows the Import button." lightbox="./media/import-function-app-as-api/append-function-api-4.png":::
114112

115113
## <a name="authorization"></a> Authorization
116114

117-
Import of an Azure Function App automatically generates:
115+
When you import an Azure function app, these items are automactically generated:
118116

119-
* Host key inside the Function App with the name apim-{*your Azure API Management service instance name*},
120-
* Named value inside the Azure API Management instance with the name {*your Azure Function App instance name*}-key, which contains the created host key.
117+
* A host key in the function app. The key is named `apim-<your API Management service instance name>`.
118+
* A named value in the API Management instance that has the name `<your Azure function app instance name>-key`. This value contains the host key.
121119

122-
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](../azure-functions/functions-bindings-http-webhook-trigger.md#api-key-authorization). You can change this behavior through the `PATCH Backend` [REST API call](/rest/api/apimanagement/current-ga/backend/update#backendcredentialscontract) on the *Backend* entity associated with the Function App.
120+
For APIs created after April 4, 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](../azure-functions/functions-bindings-http-webhook-trigger.md#api-key-authorization). You can change this behavior by using the `PATCH Backend` [REST API call](/rest/api/apimanagement/current-ga/backend/update#backendcredentialscontract) on the `Backend` entity that's associated with the function app.
123121

124122
> [!WARNING]
125-
> 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.
123+
> Removing or changing either the Azure function app host key value or the API Management named value will disable communication between the services. The values don't automatically sync.
126124
>
127-
> If you need to rotate the host key, make sure the named value in Azure API Management is also modified.
125+
> If you need to rotate the host key, be sure to also change the named value in API Management.
128126
129-
### Access Azure Function App host key
127+
### Access function app host key
130128

131-
1. Navigate to your Azure Function App instance.
129+
1. Navigate to your Azure function app instance:
132130

133-
:::image type="content" source="./media/import-function-app-as-api/keys-01.png" alt-text="Screenshot that highlights selecting your Function app instance.":::
131+
:::image type="content" source="./media/import-function-app-as-api/keys-01.png" alt-text="Screenshot that shows a list of function app instances." lightbox="./media/import-function-app-as-api/keys-01.png":::
134132

135-
2. In the **Functions** section of the side navigation menu, select **App keys**.
133+
1. In the **Functions** section of the left pane, select **App keys**:
136134

137-
:::image type="content" source="./media/import-function-app-as-api/keys-02b.png" alt-text="Screenshot that highlights the Function Apps settings option.":::
135+
:::image type="content" source="./media/import-function-app-as-api/keys-02b.png" alt-text="Screenshot that shows App keys in the menu." lightbox="./media/import-function-app-as-api/keys-02b.png":::
138136

139-
3. Find the keys under the **Host keys** section.
137+
1. Find the keys in the **Host keys** section:
140138

141-
:::image type="content" source="./media/import-function-app-as-api/keys-03.png" alt-text="Screenshot that highlights the Host Keys section.":::
139+
:::image type="content" source="./media/import-function-app-as-api/keys-03.png" alt-text="Screenshot that shows the host keys. lightbox="./media/import-function-app-as-api/keys-03.png"":::
142140

143-
### Access the named value in Azure API Management
141+
### Access the named value in API Management
144142

145-
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.
143+
Navigate to your API Management instance and select **Named values** in the left pane. The Azure function app key is stored there.
146144

147-
:::image type="content" source="./media/import-function-app-as-api/api-named-value.png" alt-text="Add from Function App":::
145+
:::image type="content" source="./media/import-function-app-as-api/api-named-value.png" alt-text="Screenshot that shows the location of the function app key." lightbox="./media/import-function-app-as-api/api-named-value.png":::
148146

149147
## <a name="test-in-azure-portal"></a> Test the new API in the Azure portal
150148

151149
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.
152150

153-
:::image type="content" source="./media/import-function-app-as-api/test-api.png" alt-text="Screenshot that highlights the test procedure.":::
151+
:::image type="content" source="./media/import-function-app-as-api/test-api.png" alt-text="Screenshot that shows the steps for testing an API.":::
154152

155153
1. Select the API that you created in the preceding section.
156154

157-
2. Select the **Test** tab.
155+
1. On the **Test** tab,
158156

159-
3. Select the operation you want to test.
157+
1. Select the operation that you want to test.
160158

161159
* The page displays fields for query parameters and headers.
162-
* One of the headers is "Ocp-Apim-Subscription-Key", for the product subscription key associated with this API.
163-
* As creator of the API Management instance, you are an administrator already, so the key is filled in automatically.
160+
* One of the headers is `Ocp-Apim-Subscription-Key`. This header is for the product subscription key that's associated with the API.
161+
* If you created the API Management instance, you're an administrator, so the key is filled in automatically.
164162

165-
4. Select **Send**.
163+
1. Select **Send**.
166164

167-
* When the test succeeds, the back end responds with **200 OK** and some data.
165+
When the test succeeds, the back end responds with **200 OK** and some data.
168166

169167
[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)]

0 commit comments

Comments
 (0)