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
Follow these steps to trace an API request in the test console in the portal. This example assumes that you [imported](import-and-publish.md) a sample API in a previous tutorial. You can follow similar steps with a different API that you imported.
44
44
@@ -52,14 +52,14 @@ Follow these steps to trace an API request in the test console in the portal. Th
52
52
53
53
> [!TIP]
54
54
>
55
-
> You can override the value of **Ocp-Apim-Subscription-Key** by retrieving a key for another subscription in the portal. Select **Subscriptions**, and open the context menu (**...**) for another subscription. Select **Show/hide keys** and copy one of the keys. You can also regenerate keys if needed. Then, in the test console, select **+ Add header** to add an **Ocp-Apim-Subscription-Key** header with the new key value.
55
+
> You can override the value of **Ocp-Apim-Subscription-Key** by retrieving a key for another subscription in the Azure portal. Select **Subscriptions**, and open the context menu (**...**) for another subscription. Select **Show/hide keys** and copy one of the keys. You can also regenerate keys if needed. Then, in the test console, select **+ Add header** to add an **Ocp-Apim-Subscription-Key** header with the new key value.
56
56
57
57
1. Select **Trace**.
58
58
59
59
## Review trace information
60
60
61
61
1. After the call completes, go to the **Trace*- tab in the **HTTP response**.
62
-
1. Select any of the following links to jump to detailed trace info: **Inbound**, **Backend**, **Outbound**, **On error**.
62
+
1. Select any of the following links to jump to detailed trace information: **Inbound**, **Backend**, **Outbound**, **On error**.
63
63
64
64
:::image type="content" source="media/api-management-howto-api-inspector/response-trace-1.png" alt-text="Screenshot showing the review response trace.":::
65
65
@@ -88,13 +88,13 @@ Detailed steps follow.
88
88
> - These steps require API Management REST API version 2023-05-01-preview or later. You must be assigned the Contributor or higher role on the API Management instance to call the REST API.
89
89
> - For information about authenticating to the REST API, see [Azure REST API reference](/rest/api/azure).
90
90
91
-
1.**Obtain a debug token**. Call the API Management gateway's [List debug credentials](/rest/api/apimanagement/gateway/list-debug-credentials) API. In the URI, enter "managed" for the instance's managed gateway in the cloud, or the gateway ID for a self-hosted gateway. For example, to obtain trace credentials for the instance's managed gateway, use a request similar to the following example:
91
+
1.**Obtain a debug token**. Call the API Management gateway's [List debug credentials](/rest/api/apimanagement/gateway/list-debug-credentials) API. In the URI, enter *managed* for the instance's managed gateway in the cloud, or the gateway ID for a self-hosted gateway. For example, to obtain trace credentials for the instance's managed gateway, use a request similar to the following example:
92
92
93
93
```http
94
94
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/managed/listDebugCredentials?api-version=2023-05-01-preview
95
95
```
96
96
97
-
In the request body, pass the full resource ID of the API that you want to trace, and specify `purposes` as `tracing`. By default the token credential returned in the response expires after 1 hour, but you can specify a different value in the payload. The expiry time is limited to a maximum of 1 hour. For example:
97
+
In the request body, pass the full resource ID of the API that you want to trace. Specify `purposes` as `tracing`. By default, the token credential returned in the response expires after 1 hour. You can specify a different value in the payload. The expiry time is limited to a maximum of 1 hour. For example:
98
98
99
99
```json
100
100
{
@@ -105,7 +105,7 @@ Detailed steps follow.
105
105
```
106
106
107
107
> [!NOTE]
108
-
> The `apiId` can only be pulled from the full resource ID, not the name displayed in the portal.
108
+
> The `apiId` can only be pulled from the full resource ID, not the name displayed in the Azure portal.
109
109
110
110
Get apiId:
111
111
@@ -156,7 +156,7 @@ Detailed steps follow.
156
156
157
157
The response body contains the trace data for the previous API request to the gateway. The trace is similar to the trace you can see by tracing a call in the portal's test console.
158
158
159
-
### Example `.http` file for VS Code REST Client extension
159
+
### Example http file for VS Code REST Client extension
160
160
161
161
To help automate these steps with the [Visual Studio Code REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) extension, you can use the following example `.http` file:
Copy file name to clipboardExpand all lines: includes/api-management-tracing-alert.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,10 @@
2
2
author: dlepow
3
3
ms.service: azure-api-management
4
4
ms.topic: include
5
-
ms.date: 11/04/2024
5
+
ms.date: 01/28/2026
6
6
ms.author: danlep
7
7
---
8
8
> [!IMPORTANT]
9
-
> * API Management no longer supports subscriptions for tracing or the **Ocp-Apim-Trace** header.
10
-
> * To improve API security, tracing can now be enabled at the level of an individual API by obtaining a time-limited token using the API Management REST API, and passing the token in a request to the gateway. For details, see [Enable tracing of an API](../articles/api-management/api-management-howto-api-inspector.md#enable-tracing-for-an-api).
11
-
> * Take care when enabling tracing, as it can expose sensitive information in the trace data. Ensure that you have appropriate security measures in place to protect the trace data.
9
+
> - API Management no longer supports subscriptions for tracing or the **Ocp-Apim-Trace** header.
10
+
> - To improve API security, tracing can now be enabled at the level of an individual API. Obtain a time-limited token using the API Management REST API. Pass the token in a request to the gateway. For details, see [Enable tracing of an API](../articles/api-management/api-management-howto-api-inspector.md#enable-tracing-for-an-api).
11
+
> - Take care when enabling tracing. It can expose sensitive information in the trace data. Ensure that you have appropriate security measures in place to protect the trace data.
0 commit comments