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
Copy file name to clipboardExpand all lines: articles/api-management/api-management-api-import-restrictions.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,12 +25,10 @@ When importing an API, you might encounter some restrictions or need to identify
25
25
During OpenAPI import, API Management:
26
26
27
27
* Checks specifically for query string parameters marked as required.
28
-
*Converts the query string parameters to template parameters.
28
+
*By default, converts the required query string parameters to required template parameters.
29
29
30
-
If you prefer a different behavior, you can either:
30
+
If you prefer that required query parameters in the specification are translated to query parameters in API Management, disable the **Include query parameters in operation templates** setting when creating the API in the portal. You can also accomplish this by using the [APIs - Create or Update](/rest/api/apimanagement/current-ga/apis/create-or-update) REST API to set the API's `translateRequiredQueryParameters` property to `query`.
31
31
32
-
* Manually change via form-based editor, or
33
-
* Remove the "required" attribute from the OpenAPI definition, thus not converting them to template parameters.
34
32
35
33
For GET, HEAD, and OPTIONS operations, API Management discards a request body parameter if defined in the OpenAPI specification.
Copy file name to clipboardExpand all lines: articles/api-management/import-and-publish.md
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
---
2
2
title: Tutorial - Import and publish your first API in Azure API Management
3
-
description: In this tutorial, you import an OpenAPI Specification API into Azure API Management, and then test your API in the Azure portal.
3
+
description: In this tutorial, you import an OpenAPI specification API into Azure API Management, and then test your API in the Azure portal.
4
4
5
5
author: dlepow
6
6
ms.service: api-management
7
-
ms.custom: mvc, devdivchpfy22
7
+
ms.custom: mvc, devdivchpfy22, engagement-fy23
8
8
ms.topic: tutorial
9
-
ms.date: 12/10/2021
9
+
ms.date: 06/15/2023
10
10
ms.author: danlep
11
11
12
12
---
13
13
# Tutorial: Import and publish your first API
14
14
15
-
This tutorial shows how to import an OpenAPI Specification backend API in JSON format into Azure API Management. Microsoft provides the backend API used in this example, and hosts it on Azure at [https://conferenceapi.azurewebsites.net?format=json](https://conferenceapi.azurewebsites.net?format=json).
15
+
This tutorial shows how to import an OpenAPI specification backend API in JSON format into Azure API Management. Microsoft provides the backend API used in this example, and hosts it on Azure at `https://conferenceapi.azurewebsites.net`.
16
16
17
17
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).
18
18
@@ -24,7 +24,7 @@ In this tutorial, you learn how to:
24
24
25
25
After import, you can manage the API in the Azure portal.
26
26
27
-
:::image type="content" source="media/import-and-publish/created-api-1.png" alt-text="New API in API Management":::
27
+
:::image type="content" source="media/import-and-publish/created-api.png" alt-text="Screenshot of a new API in API Management in the portal.":::
28
28
29
29
## Prerequisites
30
30
@@ -35,7 +35,7 @@ After import, you can manage the API in the Azure portal.
35
35
36
36
## Import and publish a backend API
37
37
38
-
This section shows how to import and publish an OpenAPI Specification backend API.
38
+
This section shows how to import and publish an OpenAPI specification backend API.
39
39
40
40
1. In the left navigation of your API Management instance, select **APIs**.
41
41
1. Select the **OpenAPI** tile.
@@ -44,19 +44,20 @@ This section shows how to import and publish an OpenAPI Specification backend AP
44
44
45
45
You can set API values during creation or later by going to the **Settings** tab.
46
46
47
-
:::image type="content" source="media/import-and-publish/open-api-specs.png" alt-text="Create an API":::
47
+
:::image type="content" source="media/import-and-publish/open-api-specs.png" alt-text="Screenshot of creating an API in the portal.":::
48
48
49
49
50
50
|Setting|Value|Description|
51
51
|-------|-----|-----------|
52
-
|**OpenAPI specification**|*https:\//conferenceapi.azurewebsites.net?format=json*|Specifies the backend service implementing the API. API Management forwards requests to this address. <br/><br/>The backend service URL appears later as the **Web service URL** on the API's **Settings** page. |
53
-
|**Display name**|After you enter the preceding service URL, API Management fills out this field based on the JSON.|The name displayed in the [developer portal](api-management-howto-developer-portal.md).|
54
-
|**Name**|After you enter the preceding service URL, API Management fills out this field based on the JSON.|A unique name for the API.|
55
-
|**Description**|After you enter the preceding service URL, API Management fills out this field based on the JSON.|An optional description of the API.|
52
+
|**OpenAPI specification**|*https:\//conferenceapi.azurewebsites.net?format=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. |
53
+
|**Include query parameters in operation templates**| Selected (default) | Specifies whether to import required query parameters in the specification as template parameters in API Management. |
54
+
|**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).|
55
+
|**Name**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|A unique name for the API.|
56
+
|**Description**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|An optional description of the API.|
56
57
|**URL scheme**|**HTTPS**|Which protocols can access the API.|
57
58
|**API URL suffix**|*conference*|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.|
58
59
|**Tags**||Tags for organizing APIs for searching, grouping, or filtering.|
59
-
|**Products**|**Unlimited**|Association of one or more APIs. Each API Management instance comes with two sample products: **Starter** and **Unlimited**. You publish an API by associating the API with a product, **Unlimited** in this example.<br/><br/> You can include several APIs in a product and offer them 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).|
60
+
|**Products**|**Unlimited**|Association of one or more APIs. Each API Management instance comes with two sample products: **Starter** and **Unlimited**. You publish an API by associating the API with a product, **Unlimited** in this example.<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).|
60
61
|**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.|
61
62
|**Version this API?**|Select or deselect|For more information, see [Publish multiple versions of your API](api-management-get-started-publish-versions.md).|
62
63
@@ -69,13 +70,15 @@ If you have problems importing an API definition, see the [list of known issues
69
70
70
71
## Test the new API in the Azure portal
71
72
72
-
You can call API operations directly from the Azure portal, which provides a convenient way to view and test the operations.
73
+
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.
73
74
74
75
1. In the left navigation of your API Management instance, select **APIs** > **Demo Conference API**.
75
-
1. Select the **Test** tab, and then select **GetSpeakers**. The page shows **Query parameters** and **Headers**, if any. The **Ocp-Apim-Subscription-Key** is filled in automatically for the subscription key associated with this API.
76
+
1. Select the **Test** tab, and then select **GetSpeakers**. The page shows **Query parameters** and **Headers**, if any.
77
+
78
+
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.
76
79
1. Select **Send**.
77
80
78
-
:::image type="content" source="media/import-and-publish/test-new-api.png" alt-text="Test API in Azure portal":::
81
+
:::image type="content" source="media/import-and-publish/test-new-api.png" alt-text="Screenshot of testing an API in Azure portal." lightbox="media/import-and-publish/test-new-api.png":::
79
82
80
83
The backend responds with **200 OK** and some data.
0 commit comments