Skip to content

Commit cca93ef

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/azure-docs-pr (branch live)
2 parents b3599d8 + 70d7486 commit cca93ef

15 files changed

Lines changed: 655 additions & 253 deletions

articles/api-management/import-and-publish.md

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Tutorial - Import and publish your first API in Azure API Management
2+
title: Tutorial - Import and Publish Your First API in Azure API Management
33
description: In this tutorial, you import an OpenAPI specification API into Azure API Management, and then test your API in the Azure portal.
44

55
author: dlepow
66
ms.service: azure-api-management
77
ms.custom: mvc, devdivchpfy22, engagement-fy23
88
ms.topic: tutorial
9-
ms.date: 10/29/2024
9+
ms.date: 01/20/2026
1010
ms.author: danlep
1111

1212
---
@@ -18,13 +18,15 @@ This tutorial shows how to import an OpenAPI specification backend API in JSON f
1818

1919
[!INCLUDE [api-management-workspace-try-it](../../includes/api-management-workspace-try-it.md)]
2020

21-
Once you import the backend API into API Management, your API Management API becomes a façade for the backend API. You can customize the façade to your needs in API Management without touching the backend API. For more information, see [Transform and protect your API](transform-api.md).
21+
When you import the backend API into API Management, your API Management API becomes a façade for the backend API. You can customize the façade to your needs in API Management without changing the backend API. For more information, see [Transform and protect your API](transform-api.md).
2222

2323
In this tutorial, you learn how to:
2424

2525
> [!div class="checklist"]
2626
> * Import an API into API Management
27+
> * View and modify API settings
2728
> * Test the API in the Azure portal
29+
> * Route API requests through API Management
2830
2931
After import, you can manage the API in the Azure portal.
3032

@@ -41,7 +43,7 @@ After import, you can manage the API in the Azure portal.
4143

4244
This section shows how to import and publish an OpenAPI specification backend API.
4345

44-
1. In the left navigation of your API Management instance, select **APIs**.
46+
1. In the left navigation of your API Management instance, under **APIs**, select **APIs**.
4547
1. Select the **OpenAPI** tile.
4648
1. In the **Create from OpenAPI specification** window, select **Full**.
4749
1. Enter the values from the following table.
@@ -53,27 +55,47 @@ This section shows how to import and publish an OpenAPI specification backend AP
5355

5456
|Setting|Value|Description|
5557
|-------|-----|-----------|
56-
|**OpenAPI specification**|*https:\//petstore3.swagger.io/api/v3/openapi.json*|Specifies the backend service implementing the API and the operations that the API supports. <br/><br/>The backend service URL appears later as the **Web service URL** on the API's **Settings** page.<br/><br/>After import, you can add, edit, rename, or delete operations in the specification. |
58+
|**OpenAPI specification**|*https:\//petstore3.swagger.io/api/v3/openapi.json* -or- *https:\//petstore.swagger.io/v2/swagger.json*|Specifies the backend service implementing the API and the operations that the API supports. <br/><br/>The backend service URL appears later as the **Web service URL** on the API's **Settings** page.<br/><br/>After import, you can add, edit, rename, or delete operations in the specification. |
5759
| **Include query parameters in operation templates** | Selected (default) | Specifies whether to import required query parameters in the specification as template parameters in API Management. |
5860
|**Display name**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|The name displayed in the [developer portal](api-management-howto-developer-portal.md).|
5961
|**Name**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|A unique name for the API.|
6062
|**Description**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|An optional description of the API.|
6163
|**URL scheme**|**HTTPS**|Which protocols can access the API.|
62-
|**API URL suffix**|*petstore*|The suffix appended to the base URL for the API Management service. API Management distinguishes APIs by their suffix, so the suffix must be unique for every API for a given publisher.|
64+
|**API URL suffix**|*petstore*|The suffix appended to the base URL for the API Management service. API Management distinguishes and routes APIs by their suffix, so the suffix must be unique for every API for a given publisher. Learn more about [how API Management routes requests](#how-api-management-routes-requests). |
6365
|**Tags**| |Tags for organizing APIs for searching, grouping, or filtering.|
6466
|**Products**|**Unlimited**|Association of one or more APIs. In certain tiers, API Management instance comes with two sample products: **Starter** and **Unlimited**. You publish an API in the developer portal by associating the API with a product.<br/><br/> You can include several APIs in a product and offer product [subscriptions](api-management-subscriptions.md) to developers through the developer portal. To add this API to another product, type or select the product name. Repeat this step to add the API to multiple products. You can also add APIs to products later from the **Settings** page.<br/><br/> For more information about products, see [Create and publish a product](api-management-howto-add-products.md).|
65-
|**Gateways**|**Managed**|API gateway(s) that expose the API. This field is available only in **Developer** and **Premium** tier services.<br/><br/>**Managed** indicates the gateway built into the API Management service and hosted by Microsoft in Azure. [Self-hosted gateways](self-hosted-gateway-overview.md) are available only in the Premium and Developer service tiers. You can deploy them on-premises or in other clouds.<br/><br/> If no gateways are selected, the API won't be available and your API requests won't succeed.|
67+
|**Gateways**|**Managed**|API gateway(s) that expose the API. This field is available only in **Developer** and **Premium** tier services.<br/><br/>**Managed** indicates the gateway built into the API Management service and hosted by Microsoft in Azure. [Self-hosted gateways](self-hosted-gateway-overview.md) are available only in the Premium and Developer service tiers. You can deploy them on-premises or in other clouds.<br/><br/> If you don't select any gateways, the API isn't available and your API requests don't succeed.|
6668
|**Version this API?**|Select or deselect|For more information, see [Publish multiple versions of your API](api-management-get-started-publish-versions.md).|
6769

6870
1. Select **Create** to create your API.
6971

7072
If you have problems importing an API definition, see the [list of known issues and restrictions](api-management-api-import-restrictions.md).
7173

74+
## View and modify API settings
75+
76+
After importing your API, you can view and modify its settings and operations in the Azure portal.
77+
78+
1. In the left navigation of your API Management instance, under **APIs**, select **APIs**.
79+
1. Select your imported API (for example, **Swagger Petstore**).
80+
:::image type="content" source="media/import-and-publish/view-api-settings.png" lightbox="media/import-and-publish/view-api-settings.png" alt-text="Screenshot of API settings in API Management in the portal.":::
81+
82+
1. Select the **Design** tab to view and modify API operations in the OpenAPI specification, including:
83+
- Operation details such as URL, method, and description
84+
- Request and response definitions
85+
- Policies to modify requests and responses
86+
1. Select the **Settings** tab to view and modify API configuration details, including:
87+
- Display name, name, and description
88+
- Web service URL (backend service), URL scheme, and API URL suffix
89+
- Products, tags, and versioning
90+
- More advanced settings, such as subscription requirements, security, and monitoring
91+
92+
As you go through the API Management tutorials, you learn more about configuring API settings. You can update these settings at any time to customize your API configuration.
93+
7294
## Test the new API in the Azure portal
7395

7496
You can call API operations directly from the Azure portal, which provides a convenient way to view and test the operations. In the portal's test console, by default, APIs are called by using a key from the built-in all-access subscription. You can also test API calls by using a subscription key scoped to a product.
7597

76-
1. In the left navigation of your API Management instance, select **APIs** > **Swagger Petstore**.
98+
1. In the left navigation of your API Management instance, select **APIs** > **APIs** > **Swagger Petstore**.
7799
1. Select the **Test** tab, and then select **Finds Pets by status**. The page shows the *status* **Query parameter**. Select one of the available values, such as *pending*. You can also add query parameters and headers here.
78100

79101
In the **HTTP request** section, the **Ocp-Apim-Subscription-Key** header is filled in automatically for you, which you can see if you select the "eye" icon.
@@ -83,13 +105,56 @@ You can call API operations directly from the Azure portal, which provides a con
83105

84106
The backend responds with **200 OK** and some data.
85107

108+
## How API Management routes requests
109+
110+
API Management acts as a gateway between your API clients and your backend services. When a client makes a request to an API managed by API Management, the routing follows this pattern:
111+
112+
**Client request URL:**
113+
`[API Management gateway URL] + [API URL suffix] + [Operation endpoint]`
114+
115+
API Management forwards the request to the backend service using this pattern:
116+
117+
**Backend service URL:**
118+
`[Web service URL] + [Operation endpoint]`
119+
120+
> [!NOTE]
121+
> The **Operation endpoint** must be identical in both the API Management API definition and the backend service for routing to work correctly. Mismatched operation endpoints result in 404 or other routing errors.
122+
>
123+
124+
The following table describes each routing parameter in the context of the Petstore API example used in this tutorial:
125+
126+
| Parameter | Description | Example (Petstore API) |
127+
|-----------|-------------|------------------------|
128+
| **API Management gateway URL** | The base URL of your API Management instance | `https://apim-hello-world.azure-api.net` |
129+
| **API URL suffix** | The unique suffix that identifies your API in API Management (configured during API creation) | `petstore` |
130+
| **Web service URL** | The base URL of your backend service derived from the OpenAPI specification | `https://petstore3.swagger.io/api/v3` |
131+
| **Operation endpoint** | The path to a specific operation endpoint (derived from your API specification) | `/pet/findByStatus` |
132+
133+
134+
### Example: Finding pets by status
135+
136+
Using the Petstore API imported in this tutorial:
137+
138+
1. **Client calls API Management:**
139+
`https://apim-hello-world.azure-api.net/petstore/pet/findByStatus?status=pending`
140+
- API Management gateway URL: `https://apim-hello-world.azure-api.net`
141+
- API URL suffix: `petstore`
142+
- Operation endpoint: `/pet/findByStatus`
143+
144+
1. **API Management routes to backend:**
145+
`https://petstore3.swagger.io/api/v3/pet/findByStatus?status=pending`
146+
- Web service URL: `https://petstore3.swagger.io/api/v3`
147+
- Operation endpoint: `/pet/findByStatus` (same as in the API Management definition)
148+
86149
## Next steps
87150

88151
In this tutorial, you learned how to:
89152

90153
> [!div class="checklist"]
91154
> * Import your first API
155+
> * View and modify API settings
92156
> * Test the API in the Azure portal
157+
> * Route API requests through API Management
93158
94159
Advance to the next tutorial to learn how to create and publish a product:
95160

-3.24 KB
Loading
195 KB
Loading

0 commit comments

Comments
 (0)