You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -30,25 +30,25 @@ In this article, you learn how to:
30
30
31
31
[Azure Container Apps](../container-apps/overview.md) allows you to deploy containerized apps without managing complex infrastructure. API developers can write code with their preferred programming language or framework, build microservices with full support for Distributed Application Runtime (Dapr), and scale based on HTTP traffic or other events.
32
32
33
-
By using API Management to expose a web API that's hosted in a container app, you gain the following benefits:
33
+
By using API Management to expose a web API hosted in a container app, you gain the following benefits:
34
34
35
35
* Decouple managing and securing the frontend that's exposed to API consumers from managing and monitoring the backend web API.
36
36
* Manage web APIs hosted as container apps in the same environment as your other APIs.
37
37
* Apply [policies](api-management-policies.md) to change API behavior, such as call-rate limiting.
38
-
* Direct API consumers to the customizable API Management [developer portal](api-management-howto-developer-portal.md) so they can discover and learn about your APIs, request access, and try APIs.
38
+
* Direct API consumers to the customizable API Management [developer portal](developer-portal-overview.md) so they can discover and learn about your APIs, request access, and try APIs.
39
39
40
-
For more information, see [About API Management](api-management-key-concepts.md).
40
+
For more information, see [What is Azure API Management?](api-management-key-concepts.md)
41
41
42
42
## OpenAPI specification vs. wildcard operations
43
43
44
-
API Management supports importing container apps that provide an OpenAPI specification (a Swagger definition). An OpenAPI specification isn't required, but we recommend that you provide one. API Management can import individual operations, which allows you to validate, manage, secure, and update configurations for each operation separately.
44
+
API Management supports importing container apps that provide an OpenAPI specification (a Swagger definition). An OpenAPI specification isn't required, but we recommend that you provide one. API Management can import individual operations, which allows you to validate, manage, secure, and update configurations for each operation separately.
45
45
46
-
If the container app exposes an OpenAPI specification, API Management creates API operations that map directly to the definition. API Management will look in several locations for an OpenAPI specification:
46
+
If the container app exposes an OpenAPI specification, API Management creates API operations that map directly to the definition. API Management looks in several locations for an OpenAPI specification:
47
47
48
48
* The container app configuration
49
-
*`/openapi.json`
50
-
*`/openapi.yml`
51
-
*`/swagger/v1/swagger.json`
49
+
**/openapi.json*
50
+
**/openapi.yml*
51
+
**/swagger/v1/swagger.json*
52
52
53
53
If an OpenAPI specification isn't provided, API Management generates [wildcard operations](add-api-manually.md#add-and-test-a-wildcard-operation) for the common HTTP verbs (GET, PUT, and so on). You can still take advantage of the same API Management features, but operations aren't defined at the same level of detail.
54
54
@@ -58,34 +58,40 @@ In either case, you can [edit](edit-api.md) or [add](add-api-manually.md) operat
58
58
59
59
Your backend container app might support two GET operations:
You import the container app to your API Management service at a path like `https://<api>.azure-api.net/store`. The following table shows the operations that are imported to API Management, either with or without an OpenAPI specification:
The wildcard operation allows the same requests to the backend service as the operations in the OpenAPI specification. However, the OpenAPI-specified operations can be managed separately in API Management.
72
72
73
73
## Prerequisites
74
74
75
-
+Complete the [Create an Azure API Management instance](get-started-create-service-instance.md) quickstart.
75
+
+ Create an [Azure API Management instance](get-started-create-service-instance.md).
76
76
+ Make sure there's a container app that exposes a web API in your subscription. For more information, see [Container Apps documentation](../container-apps/index.yml).
77
77
78
78
## Import and publish a backend API
79
79
80
-
1. Navigate to your API Management service in the Azure portal and select **APIs** > **APIs** in the left pane.
80
+
1. Navigate to your API Management service in the [Azure portal](https://portal.azure.com).
81
+
82
+
1. In the sidebar menu, under **APIs**, select **APIs**, and then select **+ Add API**.
83
+
81
84
1. Under **Create from Azure resource**, select **Container App**:
82
85
83
86
:::image type="content" source="media/import-container-app-with-oas/add-api.png" alt-text="Screenshot that shows the Container App tile.":::
84
87
85
88
1. Select **Browse** to see a list of container apps in your subscription.
89
+
86
90
1. Select a container app. If an OpenAPI definition is associated with the selected container app, API Management fetches it and imports it. If an OpenAPI definition isn't found, API Management exposes the API by generating wildcard operations for common HTTP verbs.
91
+
87
92
1. Add an **API URL suffix**. The suffix is a name that identifies the API in the API Management instance. It has to be unique in the API Management instance.
88
-
1. Associate the API with a product. Select **Full** and then, in **Product**, select the product. In this case, the **Unlimited** product is used. If you want the API to be published and be available to developers, you need to add it to a product.
93
+
94
+
1. Associate the API with a product. Select **Full** and then, in **Products**, select the product. In this case, the **Unlimited** product is used. If you want the API to be published and be available to developers, you need to add it to a product.
89
95
90
96
> [!NOTE]
91
97
> *Products* are associations of one or more APIs. You can include many APIs and offer them to developers through the developer portal. Developers must first subscribe to a product to get access to the API. When they subscribe, they get a subscription key that's good for any API in that product. If you created the API Management instance, you're an administrator and subscribed to every product by default.
@@ -95,6 +101,7 @@ The wildcard operation allows the same requests to the backend service as the op
95
101
> ***Unlimited**
96
102
97
103
1. Enter other API settings. You can set these values when you create the API or configure them later on 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.
104
+
98
105
1. Select **Create**.
99
106
100
107
:::image type="content" source="media/import-container-app-with-oas/import-container-app.png" alt-text="Screenshot that shows the Create from Container App window." lightbox="media/import-container-app-with-oas/import-container-app.png":::
@@ -106,10 +113,12 @@ You can call operations directly from the Azure portal. This method is a conveni
106
113
To test the API in the Azure portal:
107
114
108
115
1. Select the API you created in the previous step.
116
+
109
117
1. Select the **Test** tab.
118
+
110
119
1. Select an operation.
111
120
112
-
The page displays fields for query parameters and fields for the headers. One of the headers is `Ocp-Apim-Subscription-Key`. This header is for the subscription key of the product that's associated with the API. If you created the API Management instance, you're an administrator, so the key is filled in automatically.
121
+
The page displays fields for query parameters and fields for the headers. One of the headers is `Ocp-Apim-Subscription-Key`. This header is for the subscription key of the product associated with the API. If you created the API Management instance, you're an administrator, so the key is filled in automatically.
113
122
114
123
1. Select **Send**.
115
124
@@ -124,7 +133,9 @@ When wildcard operations are generated, the operations might not map directly to
124
133
To test the `/api/TodoItems` path:
125
134
126
135
1. Select the API that you created, and then select the operation.
136
+
127
137
1. Select the **Test** tab.
138
+
128
139
1. In **Template parameters**, update the value next to the wildcard (*) name. For example, enter `api/TodoItems`. This value is appended to the path `/` for the wildcard operation.
129
140
130
141
:::image type="content" source="media/import-container-app-with-oas/test-wildcard-operation.png" alt-text="Screenshot that shows the steps for testing wildcard operation." lightbox="media/import-container-app-with-oas/test-wildcard-operation.png":::
Copy file name to clipboardExpand all lines: articles/api-management/import-function-app-as-api.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ services: api-management
6
6
author: dlepow
7
7
ms.service: azure-api-management
8
8
ms.topic: how-to
9
-
ms.date: 03/28/2025
9
+
ms.date: 03/12/2026
10
10
ms.author: danlep
11
11
ms.custom: sfi-image-nochange
12
12
@@ -19,11 +19,11 @@ ms.custom: sfi-image-nochange
19
19
20
20
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.
*Complete the [Create an Azure API Management instance](get-started-create-service-instance.md) quickstart.
36
+
* Create an [Azure API Management instance](get-started-create-service-instance.md).
37
37
* Make sure you have an Azure function app in your subscription. For more information, see [Getting started with Azure Functions](../azure-functions/functions-get-started.md). The function must have an HTTP trigger. The authorization level must be set to *Anonymous* or *Function*.
38
38
39
39
> [!NOTE]
40
-
> You can also 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.
40
+
> You can also use the API Management Extension for Visual Studio Code to import and manage your APIs. To get started, complete the [API Management Extension tutorial](visual-studio-code-tutorial.md).
41
41
42
42
## Import an Azure function app as a new API
43
43
44
44
To create a new API from an Azure function app:
45
45
46
46
1. Navigate to your API Management service in the Azure portal.
47
-
1. Select **APIs** > **APIs** in the left pane.
47
+
48
+
1. Select **APIs** > **APIs** in the sidebar menu.
48
49
49
50
1. Under **Create from Azure resource**, select **Function App**:
50
51
@@ -77,15 +78,13 @@ To create a new API from an Azure function app:
77
78
78
79
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.
79
80
80
-
81
-
82
81
1. Select **Create**.
83
82
84
83
## Append a function app to an existing API
85
84
86
85
To append a function app to an existing API:
87
86
88
-
1. In your **Azure API Management** service instance, select **APIs** > **APIs** in the left pane.
87
+
1. In your **Azure API Management** service instance, select **APIs** > **APIs** in the sidebar menu.
89
88
90
89
1. Choose an API that you want to import a function app to. Select the ellipsis (**...**) next to the API, and then select **Import**:
91
90
@@ -125,7 +124,7 @@ When you import an Azure function app, these items are automatically generated:
125
124
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.
126
125
127
126
> [!WARNING]
128
-
> 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.
127
+
> Removing or changing either the Azure function app host key value or the API Management named value disables communication between the services. The values don't automatically sync.
129
128
>
130
129
> If you need to rotate the host key, be sure to also change the named value in API Management.
131
130
@@ -135,17 +134,13 @@ For APIs created after April 4, 2019, the host key is passed in HTTP requests fr
135
134
136
135
:::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":::
137
136
138
-
1. In the **Functions** section of the left pane, select **App keys**:
137
+
1. In the **Functions** section of the sidebar menu, select **App keys**. Find the keys in the **Host keys** section:
139
138
140
139
:::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":::
141
140
142
-
1. Find the keys in the **Host keys** section:
143
-
144
-
:::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":::
145
-
146
141
### Access the named value in API Management
147
142
148
-
Navigate to your API Management instance and select **APIs** > **Named values** in the left pane. The Azure function app key is stored there.
143
+
Navigate to your API Management instance and select **APIs** > **Named values** in the sidebar menu. The Azure function app key is stored there.
149
144
150
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":::
0 commit comments