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-howto-app-insights.md
+24-22Lines changed: 24 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,20 +23,28 @@ You can easily integrate Azure Application Insights with Azure API Management. A
23
23
24
24
* 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).
25
25
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.
28
28
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
+
29
37
## Scenario overview
30
38
31
39
1. First, you create a connection between Application Insights and API Management
32
40
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.
34
42
35
43
> [!NOTE]
36
44
> 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).
37
45
38
46
> [!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.
40
48
>
41
49
42
50
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
57
65
* This setting regularly validates whether the API Management gateway endpoint is responding.
58
66
* Results appear in the **Availability** pane of the Application Insights instance.
59
67
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
+
61
70
:::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.":::
62
71
63
72
> [!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.
65
74
66
75
> [!TIP]
67
76
> 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
70
79
71
80
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.
72
81
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
-
82
82
### Logger with connection string credentials
83
83
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.
0 commit comments