Skip to content

Commit c7db760

Browse files
committed
updates
1 parent 2f47245 commit c7db760

File tree

1 file changed

+47
-45
lines changed

1 file changed

+47
-45
lines changed
Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Import Azure Container App to Azure API Management | Microsoft Docs
3-
description: This article shows you how to use Azure API Management to import a web API hosted in Azure Container Apps.
2+
title: Import an Azure Container App to Azure API Management | Microsoft Docs
3+
description: Learn how to use Azure API Management to import a web API that's hosted in Azure Container Apps.
44
services: api-management
55
author: dlepow
66

@@ -9,107 +9,109 @@ ms.topic: how-to
99
ms.date: 03/31/2025
1010
ms.author: danlep
1111

12+
#customer intent: As an API developer, I want to import a web API that's hosted in Azure Container Apps.
13+
1214
---
13-
# Import an Azure Container App as an API
15+
# Import an Azure container app as an API
1416

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

17-
This article shows how to import an Azure Container App to Azure API Management and test the imported API using the Azure portal.
19+
This article describes how to import an Azure Container App to Azure API Management and test the imported API by using the Azure portal.
1820

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

2123
In this article, you learn how to:
2224

2325
> [!div class="checklist"]
24-
> * Import a Container App that exposes a Web API
26+
> * Import a Container App that exposes a web API
2527
> * Test the API in the Azure portal
2628
27-
## Expose Container App with API Management
29+
## Expose a container app by using API Management
2830

2931
[Azure Container Apps](../container-apps/overview.md) allows you to deploy containerized apps without managing complex infrastructure. API developers can write code using 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.
3032

31-
API Management is the recommended environment to expose a Container App hosted web API, for several reasons:
33+
By using API Management to expose a web API that's hosted in a container app, you gain the following benenfits:
3234

33-
* Decouple managing and securing the front end exposed to API consumers from managing and monitoring the backend web API
34-
* Manage web APIs hosted as Container Apps in the same environment as your other APIs
35-
* Apply [policies](api-management-policies.md) to change API behavior, such as call rate limiting
36-
* Direct API consumers to API Management's customizable [developer portal](api-management-howto-developer-portal.md) to discover and learn about your APIs, request access, and try them
35+
* Decouple managing and securing the frontend that's exposed to API consumers from managing and monitoring the backend web API.
36+
* Manage web APIs hosted as container apps in the same environment as your other APIs.
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.
3739

3840
For more information, see [About API Management](api-management-key-concepts.md).
3941

40-
## OpenAPI specification versus wildcard operations
42+
## OpenAPI specification vs. wildcard operations
4143

42-
API Management supports import of Container Apps that provide an OpenAPI specification (Swagger definition). However, an OpenAPI specification isn't required. We recommend providing an OpenAPI specification. API Management can import individual operations, allowing 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). However, an OpenAPI specification isn't required. We recommend that you provide an OpenAPI specification. API Management can import individual operations, which allows you to validate, manage, secure, and update configurations for each operation separately.
4345

44-
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 will look in several locations for an OpenAPI specification:
4547

46-
* The Container App configuration.
48+
* The container app configuration
4749
* `/openapi.json`
4850
* `/openapi.yml`
4951
* `/swagger/v1/swagger.json`
5052

5153
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.
5254

53-
In either case, you can [edit](edit-api.md) or [add](add-api-manually.md) operations to the API after import.
55+
In either case, you can [edit](edit-api.md) or [add](add-api-manually.md) operations to the API after you import it.
5456

5557
### Example
5658

57-
Your backend Container App might support two GET operations:
59+
Your backend container app might support two GET operations:
5860

5961
* `https://myappservice.azurewebsites.net/customer/{id}`
6062
* `https://myappservice.azurewebsites.net/customers`
6163

62-
You import the Container App to your API Management service at a path such as `https://contosoapi.azure-api.net/store`. The following table shows the operations that are imported to API Management, either with or without an OpenAPI specification:
64+
You import the container app to your API Management service at a path like `https://contosoapi.azure-api.net/store`. The following table shows the operations that are imported to API Management, either with or without an OpenAPI specification:
6365

6466
| Type |Imported operations |Sample requests |
6567
|---------|---------|---------|
66-
|OpenAPI specification | `GET /customer/{id}`<br/><br/> `GET /customers` | `GET https://contosoapi.azure-api.net/store/customer/1`<br/><br/>`GET https://contosoapi.azure-api.net/store/customers` |
67-
|Wildcard | `GET /*` | `GET https://contosoapi.azure-api.net/store/customer/1`<br/><br/>`GET https://contosoapi.azure-api.net/store/customers` |
68+
|OpenAPI specification | `GET /customer/{id}`<br/><br/> `GET /customers` | `GET https://<api>.azure-api.net/store/customer/1`<br/><br/>`GET https://<api>.azure-api.net/store/customers` |
69+
|Wildcard | `GET /*` | `GET https://contosoapi.azure-api.net/store/customer/1`<br/><br/>`GET https://<api>.azure-api.net/store/customers` |
6870

6971
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.
7072

7173
## Prerequisites
7274

73-
+ Complete the following quickstart: [Create an Azure API Management instance](get-started-create-service-instance.md).
74-
+ 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).
75-
76-
[!INCLUDE [api-management-navigate-to-instance.md](../../includes/api-management-navigate-to-instance.md)]
75+
+ Complete the [Create an Azure API Management instance](get-started-create-service-instance.md) quickstart.
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).
7777

78-
## <a name="create-api"> </a>Import and publish a backend API
78+
## Import and publish a backend API
7979

80-
1. Navigate to your API Management service in the Azure portal and select **APIs** from the menu.
81-
2. Select **Container App** from the list.
80+
1. Navigate to your API Management service in the Azure portal and select **APIs** > **APIs** in the left pane.
81+
1. Under **Create from Azure resource**, select **Container App**:
8282

83-
:::image type="content" source="media/import-container-app-with-oas/add-api.png" alt-text="Create from Container App":::
83+
:::image type="content" source="media/import-container-app-with-oas/add-api.png" alt-text="Screenshot that shows the Container App tile.":::
8484

85-
3. Select **Browse** to see the list of Container Apps in your subscription.
86-
4. 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.
87-
1. Add an API URL suffix. The suffix is a name that identifies this specific API in this API Management instance. It has to be unique in this API Management instance.
88-
2. Publish the API by associating the API with a product. In this case, the "*Unlimited*" product is used. If you want the API to be published and be available to developers, add it to a product.
85+
1. Select **Browse** to see a list of container apps in your subscription.
86+
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.
87+
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. Publish the API by associating the API with a product. In this case, the **Unlimited** product is used. If you want the API to be published and be available to developers, add it to a product.
8989

9090
> [!NOTE]
91-
> 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 is 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.
91+
> *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 is 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.
9292
>
93-
> Each API Management instance comes with two sample products when created:
93+
> In some pricing tiers, an API Management instance comes with two sample products when you create it:
9494
> * **Starter**
9595
> * **Unlimited**
9696
97-
3. Enter other API settings. You can set the values during creation or configure them later by going to the **Settings** tab. The settings are explained in the [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api) tutorial.
98-
4. Select **Create**.
97+
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.
98+
1. Select **Create**.
9999

100-
:::image type="content" source="media/import-container-app-with-oas/import-container-app.png" alt-text="Create API from Container App":::
100+
:::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":::
101101

102102
## Test the new API in the Azure portal
103103

104-
Operations can be called directly from the Azure portal, which provides a convenient way to view and test the operations of an API. You can also test the API in the [developer portal](api-management-howto-developer-portal.md) or using your own REST client tools.
104+
Operations can be called directly from the Azure portal. This method is a convenient way to view and test the operations of an API. You can also test the API in the [developer portal](api-management-howto-developer-portal.md) or by using your own REST client tools.
105+
106+
To test the API in the Azure portal:
105107

106108
1. Select the API you created in the previous step.
107109
1. Select the **Test** tab.
108110
1. Select an operation.
109111

110-
The page displays fields for query parameters and fields for the headers. One of the headers is `Ocp-Apim-Subscription-Key`, for the subscription key of the product that is associated with this API. If you created the API Management instance, you are an administrator already, so the key is filled in automatically.
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 are an administrator, so the key is filled in automatically.
111113

112-
1. Press **Send**.
114+
1. Select **Send**.
113115

114116
When the test is successful, the backend responds with **200 OK** and some data.
115117

@@ -119,16 +121,16 @@ When wildcard operations are generated, the operations might not map directly to
119121

120122
`/api/TodoItems`
121123

122-
You can test the path `/api/TodoItems` as follows.
124+
You can test the path `/api/TodoItems` as follows:
123125

124-
1. Select the API you created, and select the operation.
126+
1. Select the API that you created, and then select the operation.
125127
1. Select the **Test** tab.
126-
1. In **Template parameters**, update the value next to the wildcard (*) name. For example, enter `api/TodoItems`. This value gets appended to the path `/` for the wildcard operation.
128+
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.
127129

128-
:::image type="content" source="media/import-container-app-with-oas/test-wildcard-operation.png" alt-text="Test wildcard operation":::
130+
:::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":::
129131

130132
1. Select **Send**.
131133

132-
[!INCLUDE [api-management-navigate-to-instance.md](../../includes/api-management-append-apis.md)]
134+
[!INCLUDE [api-management-append-apis.md](../../includes/api-management-append-apis.md)]
133135

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

0 commit comments

Comments
 (0)