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
@@ -20,7 +20,7 @@ You can easily integrate Azure Application Insights with Azure API Management. A
20
20
* Learn strategies for reducing performance impact on your API Management service instance.
21
21
22
22
> [!NOTE]
23
-
> In an API Management [workspace](workspaces-overview.md), a workspace owner can independently integrate Application Insights and enable Application Insights logging for the workspace's APIs. The general guidance to integrate a workspace with Application Insights is similar to the guidance for an API Management instance; however, configuration is scoped to the workspace only. Currently, you must integrate Application Insights in a workspace by configuring an instrumentation key or connection string.
23
+
> In an API Management [workspace](workspaces-overview.md), a workspace owner can independently integrate Application Insights and enable Application Insights logging for the workspace's APIs. The general guidance to integrate a workspace with Application Insights is similar to the guidance for an API Management instance; however, configuration is scoped to the workspace only. Currently, you must integrate Application Insights in a workspace by configuring a connection string (recommended) or an instrumentation key.
24
24
25
25
> [!WARNING]
26
26
> When using our [self-hosted gateway](self-hosted-gateway-overview.md), we do not guarantee all telemetry will be pushed to Azure Application Insights given it relies on [Application Insights' in-memory buffering](./../azure-monitor/app/telemetry-channels.md#built-in-telemetry-channels).
@@ -34,9 +34,9 @@ You can easily integrate Azure Application Insights with Azure API Management. A
34
34
> [!NOTE]
35
35
> The Application Insights resource **can be** in a different subscription or even a different tenant than the API Management resource.
36
36
37
-
* If you plan to configure a managed identity for API Management to use with Application Insights, you need to complete the following steps:
37
+
* If you plan to configure managed identity credentials to use with Application Insights, complete the following steps:
38
38
39
-
1. Enable a system-assigned or user-assigned [managed identity for API Management](api-management-howto-use-managed-service-identity.md) in your API Management instance.
39
+
1. Enable a system-assigned or user-assigned [managed identity for API Management](api-management-howto-use-managed-service-identity.md).
40
40
41
41
* If you enable a user-assigned managed identity, take note of the identity's **Client ID**.
42
42
@@ -46,18 +46,18 @@ You can easily integrate Azure Application Insights with Azure API Management. A
46
46
47
47
The following are high level steps for this scenario.
48
48
49
-
1. First, you create a connection between Application Insights and API Management
49
+
1. First, create a connection between Application Insights and API Management
50
50
51
51
You can create a connection between Application Insights and your API Management using the Azure portal, the REST API, or related Azure tools. API Management configures a *logger* resource for the connection.
52
52
53
-
> [!NOTE]
54
-
> If your Application Insights resource is in a different tenant, then you must create the logger using the [REST API](#create-a-connection-using-the-rest-api-bicep-or-arm-template) as shown in a later section of this article.
55
-
56
53
> [!IMPORTANT]
57
-
> Currently, in the portal, API Management only supports connections to Application Insights using an Application Insights instrumentation key. To use an Application Insights connection string or an API Management managed identity, use the REST API, Bicep, or ARM template to create the logger. [Learn more](../azure-monitor/app/sdk-connection-string.md) about Application Insights connection strings.
54
+
> Currently, in the portal, API Management only supports connections to Application Insights using an Application Insights instrumentation key. For enhanced security, we recommend using an Application Insights connection string with an API Management managed identity. To configure a connection string with a managed identity, use the [REST API](#create-a-connection-using-the-rest-api-bicep-or-arm-template)or related tools as shown in a later section of this article. [Learn more](../azure-monitor/app/sdk-connection-string.md) about Application Insights connection strings.
58
55
>
59
56
60
-
1. Second, you enable Application Insights logging for your API or APIs.
57
+
> [!NOTE]
58
+
> If your Application Insights resource is in a different tenant, then you must create the logger using the [REST API](#create-a-connection-using-the-rest-api-bicep-or-arm-template) or related tools as shown in a later section of this article.
59
+
60
+
1. Second, enable Application Insights logging for your API or APIs.
61
61
62
62
In this article, you enable Application Insights logging for your API using the Azure portal. API Management configures a *diagnostic* resource for the API.
63
63
@@ -66,6 +66,10 @@ The following are high level steps for this scenario.
66
66
67
67
Follow these steps to use the Azure portal to create a connection between Application Insights and API Management.
68
68
69
+
> [!NOTE]
70
+
> Where possible, Microsoft recommends using a connection string with a managed identity for enhanced security. To configure a connection string with a managed identity, use the [REST API](#create-a-connection-using-the-rest-api-bicep-or-arm-template) or related tools as shown in a later section of this article.
71
+
72
+
69
73
1. Navigate to your **Azure API Management service instance** in the **Azure portal**.
70
74
1. Select **Application Insights** from the menu on the left.
71
75
1. Select **+ Add**.
@@ -87,28 +91,31 @@ Follow these steps to use the Azure portal to create a connection between Applic
87
91
88
92
## Create a connection using the REST API, Bicep, or ARM template
89
93
90
-
Follow these steps to use the REST API, Bicep, or ARM template to create a connection between Application Insights and API Management. You can configure a logger that uses a connection string, system-assigned managed identity, or user-assigned managed identity.
94
+
Follow these steps to use the REST API, Bicep, or ARM template to create an Application Insights logger for your API Management instance. You can configure a logger that uses a system-assigned or user-assigned managed identity with a connection string (recommended), or a logger that uses only a connection string.
95
+
96
+
97
+
### Logger with system-assigned managed identity and connection string credentials
91
98
92
-
### Logger with connection string credentials
99
+
See the [prerequisites](#prerequisites) for using an API Management managed identity.
93
100
94
101
The Application Insights connection string appears in the **Overview** section of your Application Insights resource.
95
102
96
103
#### [REST API](#tab/rest)
97
104
98
105
Use the API Management [Logger - Create or Update](/rest/api/apimanagement/current-preview/logger/create-or-update) REST API with the following request body.
99
106
100
-
If you are configuring the logger for a workspace, use the [Workspace Logger - Create or Update](/rest/api/apimanagement/workspace-logger/create-or-update?view=rest-apimanagement-2023-09-01-preview&preserve-view=true) REST API.
101
-
102
107
```JSON
103
108
{
104
109
"properties": {
105
110
"loggerType": "applicationInsights",
106
-
"description": "adding a new logger with connection string",
111
+
"description": "adding a new logger with system-assigned managed identity",
### Logger with user-assigned managed identity credentials
216
223
217
-
See the [prerequisites](#prerequisites) for using an API Management managed identity.
224
+
### Logger with connection string credentials only
225
+
226
+
The Application Insights connection string appears in the **Overview** section of your Application Insights resource.
218
227
219
228
#### [REST API](#tab/rest)
220
229
221
230
Use the API Management [Logger - Create or Update](/rest/api/apimanagement/current-preview/logger/create-or-update) REST API with the following request body.
222
231
232
+
If you are configuring the logger for a workspace, use the [Workspace Logger - Create or Update](/rest/api/apimanagement/workspace-logger/create-or-update?view=rest-apimanagement-2023-09-01-preview&preserve-view=true) REST API.
233
+
223
234
```JSON
224
235
{
225
236
"properties": {
226
237
"loggerType": "applicationInsights",
227
-
"description": "adding a new logger with user-assigned managed identity",
238
+
"description": "adding a new logger with connection string",
0 commit comments