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
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ The following are high level steps for this scenario.
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
53
> [!IMPORTANT]
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 managed identity and connection string credentials, 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.
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 connection string with managed identity credentials, 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.
55
55
>
56
56
57
57
> [!NOTE]
@@ -67,7 +67,7 @@ The following are high level steps for this scenario.
67
67
Follow these steps to use the Azure portal to create a connection between Application Insights and API Management.
68
68
69
69
> [!NOTE]
70
-
> Where possible, Microsoft recommends using managed identity and connection string credentials for enhanced security. To configure these credentials, 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.
70
+
> Where possible, Microsoft recommends using connection string with managed identity credentials for enhanced security. To configure these credentials, 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
71
72
72
73
73
1. Navigate to your **Azure API Management service instance** in the **Azure portal**.
@@ -91,15 +91,15 @@ Follow these steps to use the Azure portal to create a connection between Applic
91
91
92
92
## Create a connection using the REST API, Bicep, or ARM template
93
93
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 managed identity with connection string credentials (recommended), or a logger that uses only a connection string.
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 connection string with managed identity credentials (recommended), or a logger that uses only a connection string.
95
95
96
-
### Logger with managed identity and connection string credentials (recommended)
96
+
### Logger with connection string with managed identity credentials (recommended)
97
97
98
98
See the [prerequisites](#prerequisites) for using an API Management managed identity.
99
99
100
100
The Application Insights connection string appears in the **Overview** section of your Application Insights resource.
101
101
102
-
#### System-assigned managed identity and connection string
102
+
#### Connection string with system-assigned managed identity
103
103
104
104
#### [REST API](#tab/rest)
105
105
@@ -109,7 +109,7 @@ Use the API Management [Logger - Create or Update](/rest/api/apimanagement/curre
109
109
{
110
110
"properties": {
111
111
"loggerType": "applicationInsights",
112
-
"description": "adding a new logger with system-assigned managed identity",
112
+
"description": "Application Insights logger with system-assigned managed identity",
Include a JSON snippet similar to the following in your Azure Resource Manager template.
266
269
270
+
If you are configuring the logger for a workspace, create a `Microsoft.ApiManagement/service.workspace/loggers` resource and set `apiVersion` to `2023-09-01-preview` instead.
> See [Application Insights limits](../azure-monitor/service-limits.md#application-insights) for information about the maximum size and number of metrics and events per Application Insights instance.
336
342
337
343
## Emit custom metrics
338
-
You can emit [custom metrics](../azure-monitor/essentials/metrics-custom-overview.md) to Application Insights from your API Management instance. API Management emits custom metrics using the [emit-metric](emit-metric-policy.md) policy.
344
+
You can emit [custom metrics](../azure-monitor/essentials/metrics-custom-overview.md) to Application Insights from your API Management instance. API Management emits custom metrics using policies such as [emit-metric](emit-metric-policy.md)and [azure-openai-emit-token-metric](azure-openai-emit-token-metric-policy.md). The following section uses the `emit-metric` policy as an example.
339
345
340
346
> [!NOTE]
341
347
> Custom metrics are a [preview feature](../azure-monitor/essentials/metrics-custom-overview.md) of Azure Monitor and subject to [limitations](../azure-monitor/essentials/metrics-custom-overview.md#design-limitations-and-considerations).
@@ -369,7 +375,7 @@ To emit custom metrics, perform the following configuration steps.
369
375
370
376
### Limits for custom metrics
371
377
372
-
Azure Monitor imposes [usage limits](../azure-monitor/essentials/metrics-custom-overview.md#quotas-and-limits) for custom metrics that may affect your ability to emit metrics from API Management. For example, Azure Monitor currently sets a limit of 10 dimension keys per metric, and a limit of 50,000 total active time series per region in a subscription (within a 12 hour period).
378
+
Azure Monitor imposes [usage limits](../azure-monitor/essentials/metrics-custom-overview.md#quotas-and-limits) for custom metrics that may affect your ability to emit metrics from API Management. For example, Azure Monitor currently sets a limit of 10 dimension keys per metric, and a limit of 50,000 total active time series per region in a subscription (within a 12 hour period).
373
379
374
380
These limits have the following implications for configuring custom metrics in API Management:
Copy file name to clipboardExpand all lines: articles/api-management/api-management-howto-log-event-hubs.md
+23-21Lines changed: 23 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,11 @@ To log events to the event hub, you need to configure credentials for access fro
34
34
* A managed identity for your API Management instance (recommended)
35
35
* An Event Hubs connection string
36
36
37
-
### Option 1: Configure API Management managed identity
38
-
39
37
> [!NOTE]
40
-
> Using an API Management managed identity for logging events to an event hub is supported in API Management REST API version `2022-04-01-preview` or later.
38
+
> Where possible, Microsoft recommends using managed identity credentials for enhanced security.
39
+
40
+
41
+
### Option 1: Configure API Management managed identity
41
42
42
43
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.
43
44
@@ -59,7 +60,7 @@ The next step is to configure a [logger](/rest/api/apimanagement/current-ga/logg
59
60
60
61
Create and manage API Management loggers by using the [API Management REST API](/rest/api/apimanagement/current-preview/logger/create-or-update) directly or by using tools including [Azure PowerShell](/powershell/module/az.apimanagement/new-azapimanagementlogger), a Bicep template, or an Azure Resource Management template.
61
62
62
-
### Logger with managed identity credentials (recommended)
63
+
### Option 1: Logger with managed identity credentials (recommended)
63
64
64
65
You can configure an API Management logger to an event hub using either system-assigned or user-assigned managed identity credentials.
65
66
@@ -69,13 +70,13 @@ For prerequisites, see [Configure API Management managed identity](#option-1-con
69
70
70
71
#### [REST API](#tab/PowerShell)
71
72
72
-
Use the API Management [REST API](/rest/api/apimanagement/current-preview/logger/create-or-update)or a Bicep or ARM template to configure a logger to an event hub with system-assigned managed identity credentials.
73
+
Use the API Management [Logger - Create or Update](/rest/api/apimanagement/current-preview/logger/create-or-update)REST API with the following request body.
73
74
74
75
```JSON
75
76
{
76
77
"properties": {
77
78
"loggerType": "azureEventHub",
78
-
"description": "adding a new logger with systemassigned managed identity",
79
+
"description": "Event Hub logger with system-assigned managed identity",
@@ -134,13 +135,14 @@ For prerequisites, see [Configure API Management managed identity](#option-1-con
134
135
135
136
#### [REST API](#tab/PowerShell)
136
137
137
-
Use the API Management [REST API](/rest/api/apimanagement/current-preview/logger/create-or-update) or a Bicep or ARM template to configure a logger to an event hub with user-assigned managed identity credentials.
138
+
Use the API Management [Logger - Create or Update](/rest/api/apimanagement/current-preview/logger/create-or-update) REST API with the following request body.
139
+
138
140
139
141
```JSON
140
142
{
141
143
"properties": {
142
144
"loggerType": "azureEventHub",
143
-
"description": "adding a new logger with user-assigned managed identity",
145
+
"description": "Event Hub logger with user-assigned managed identity",
0 commit comments