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
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).
22
22
23
23
In this tutorial, you learn how to:
24
24
25
25
> [!div class="checklist"]
26
26
> * Import an API into API Management
27
+
> * View and modify API settings
27
28
> * Test the API in the Azure portal
29
+
> * Route API requests through API Management
28
30
29
31
After import, you can manage the API in the Azure portal.
30
32
@@ -41,7 +43,7 @@ After import, you can manage the API in the Azure portal.
41
43
42
44
This section shows how to import and publish an OpenAPI specification backend API.
43
45
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**.
45
47
1. Select the **OpenAPI** tile.
46
48
1. In the **Create from OpenAPI specification** window, select **Full**.
47
49
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
53
55
54
56
|Setting|Value|Description|
55
57
|-------|-----|-----------|
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. |
57
59
|**Include query parameters in operation templates**| Selected (default) | Specifies whether to import required query parameters in the specification as template parameters in API Management. |
58
60
|**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).|
59
61
|**Name**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|A unique name for the API.|
60
62
|**Description**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|An optional description of the API.|
61
63
|**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). |
63
65
|**Tags**||Tags for organizing APIs for searching, grouping, or filtering.|
64
66
|**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.|
66
68
|**Version this API?**|Select or deselect|For more information, see [Publish multiple versions of your API](api-management-get-started-publish-versions.md).|
67
69
68
70
1. Select **Create** to create your API.
69
71
70
72
If you have problems importing an API definition, see the [list of known issues and restrictions](api-management-api-import-restrictions.md).
71
73
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
+
72
94
## Test the new API in the Azure portal
73
95
74
96
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.
75
97
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**.
77
99
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.
78
100
79
101
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
83
105
84
106
The backend responds with **200 OK** and some data.
85
107
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:
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) |
0 commit comments