Skip to content

Commit 50173c1

Browse files
committed
syntax
1 parent 0681455 commit 50173c1

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

articles/api-management/api-management-howto-app-insights.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,28 @@ You can easily integrate Azure Application Insights with Azure API Management. A
2323

2424
* To use Application Insights, [create an instance of the Application Insights service](/previous-versions/azure/azure-monitor/app/create-new-resource). To create an instance using the Azure portal, see [Workspace-based Application Insights resources](../azure-monitor/app/create-workspace-resource.md).
2525

26-
> [!NOTE]
27-
> The Application Insights resource **can be** in a different subscription or even a different tenant than the API Management resource.
26+
> [!NOTE]
27+
> The Application Insights resource **can be** in a different subscription or even a different tenant than the API Management resource.
2828
29+
* If you plan to configure a managed identity for API Management to use with Application Insights, you need to complete the following steps:
30+
31+
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.
32+
33+
* If you enable a user-assigned managed identity, take note of the identity's **Client ID**.
34+
35+
1. Assign the identity the **Monitoring Metrics Publisher** role, scoped to the Application Insights resource. To assign the role, use the [Azure portal](../active-directory/managed-identities-azure-resources/howto-assign-access-portal.md) or other Azure tools.
36+
2937
## Scenario overview
3038

3139
1. First, you create a connection between Application Insights and API Management
3240

33-
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.
41+
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.
3442

3543
> [!NOTE]
3644
> If your Application Insights resource is in a different tenant, then you must create the logger using the [REST API](/rest/api/apimanagement/current-ga/logger/create-or-update).
3745
3846
> [!IMPORTANT]
39-
> 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.
47+
> 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.
4048
>
4149
4250
1. Second, you enable Application Insights logging for your API or APIs.
@@ -57,11 +65,12 @@ Follow these steps to use the Azure portal to create a connection between Applic
5765
* This setting regularly validates whether the API Management gateway endpoint is responding.
5866
* Results appear in the **Availability** pane of the Application Insights instance.
5967
1. Select **Create**.
60-
1. Check that the new Application Insights logger now appears in the list.
68+
1. Check that the new Application Insights logger now appears in the list.
69+
6170
:::image type="content" source="media/api-management-howto-app-insights/apim-app-insights-logger-2.png" alt-text="Screenshot that shows where to view the newly created Application Insights logger.":::
6271

6372
> [!NOTE]
64-
> Behind the scenes, a [logger](/rest/api/apimanagement/current-ga/logger/create-or-update) entity is created in your API Management instance, containing the instrumentation key of the Application Insights instance.
73+
> Behind the scenes, a logger entity is created in your API Management instance, containing the instrumentation key of the Application Insights instance.
6574
6675
> [!TIP]
6776
> If you need to update the instrumentation key configured in the Application Insights logger, select the logger's row in the list (not the name of the logger). Enter the instrumentation key, and select **Save**.
@@ -70,18 +79,9 @@ Follow these steps to use the Azure portal to create a connection between Applic
7079

7180
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 identity, or user-assigned identity.
7281

73-
The following prerequisites are needed to configure a managed identity for API Management:
74-
75-
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.
76-
77-
* If you enable a user-assigned managed identity, take note of the identity's **Client ID**.
78-
79-
1. Assign the identity the **Monitoring Metrics Publisher** role, scoped to the Application Insights resource. To assign the role, use the [Azure portal](../active-directory/managed-identities-azure-resources/howto-assign-access-portal.md) or other Azure tools.
80-
81-
8282
### Logger with connection string credentials
8383

84-
Your connection string appears in the **Overview** section of your Application Insights resource.
84+
The Application Insights connection string appears in the **Overview** section of your Application Insights resource.
8585

8686
#### [REST API](#tab/rest)
8787

@@ -109,7 +109,7 @@ resource aiLoggerWithSystemAssignedIdentity 'Microsoft.ApiManagement/service/log
109109
parent: '<APIManagementInstanceName>'
110110
properties: {
111111
loggerType: 'applicationInsights'
112-
description: 'Application Insights logger with system-assigned managed identity'
112+
description: 'Application Insights logger with connection string'
113113
credentials: {
114114
connectionString: 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/;...'
115115
}
@@ -128,7 +128,7 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
128128
"name": "ContosoLogger1",
129129
"properties": {
130130
"loggerType": "applicationInsights",
131-
"description": "Application Insights logger with system-assigned managed identity",
131+
"description": "Application Insights logger with connection string",
132132
"resourceId": "<ApplicationInsightsResourceID>",
133133
"credentials": {
134134
"connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/;..."
@@ -140,6 +140,8 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
140140

141141
### Logger with system-assigned managed identity credentials
142142

143+
See the [prerequisites](#prerequisites) for using an API Management managed identity.
144+
143145
#### [REST API](#tab/rest)
144146

145147
Use the API Management [REST API](/rest/api/apimanagement/current-preview/logger/create-or-update) with the following request body.
@@ -148,7 +150,7 @@ Use the API Management [REST API](/rest/api/apimanagement/current-preview/logger
148150
{
149151
"properties": {
150152
"loggerType": "applicationInsights",
151-
"description": "adding a new logger with system assigned managed identity",
153+
"description": "adding a new logger with system-assigned managed identity",
152154
"credentials": {
153155
"connectionString":"InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/;...",
154156
"identityClientId":"SystemAssigned"
@@ -200,17 +202,17 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
200202
---
201203
### Logger with user-assigned managed identity credentials
202204

203-
For prerequisites, see [Configure API Management managed identity](#option-2-configure-api-management-managed-identity).
205+
See the [prerequisites](#prerequisites) for using an API Management managed identity.
204206

205-
#### [REST API](#tab/PowerShell)
207+
#### [REST API](#tab/rest)
206208

207209
Use the API Management [REST API](/rest/api/apimanagement/current-preview/logger/create-or-update) with the following request body.
208210

209211
```JSON
210212
{
211213
"properties": {
212214
"loggerType": "applicationInsights",
213-
"description": "adding a new logger with system assigned managed identity",
215+
"description": "adding a new logger with user-assigned managed identity",
214216
"credentials": {
215217
"connectionString":"InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/;...",
216218
"identityClientId":"<ClientID>"

0 commit comments

Comments
 (0)