Skip to content

Commit 7c20201

Browse files
committed
edits
1 parent cb4d94d commit 7c20201

File tree

2 files changed

+40
-32
lines changed

2 files changed

+40
-32
lines changed

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The following are high level steps for this scenario.
5151
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.
5252

5353
> [!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.
5555
>
5656
5757
> [!NOTE]
@@ -67,7 +67,7 @@ The following are high level steps for this scenario.
6767
Follow these steps to use the Azure portal to create a connection between Application Insights and API Management.
6868

6969
> [!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.
7171
7272

7373
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
9191
9292
## Create a connection using the REST API, Bicep, or ARM template
9393

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.
9595

96-
### Logger with managed identity and connection string credentials (recommended)
96+
### Logger with connection string with managed identity credentials (recommended)
9797

9898
See the [prerequisites](#prerequisites) for using an API Management managed identity.
9999

100100
The Application Insights connection string appears in the **Overview** section of your Application Insights resource.
101101

102-
#### System-assigned managed identity and connection string
102+
#### Connection string with system-assigned managed identity
103103

104104
#### [REST API](#tab/rest)
105105

@@ -109,7 +109,7 @@ Use the API Management [Logger - Create or Update](/rest/api/apimanagement/curre
109109
{
110110
"properties": {
111111
"loggerType": "applicationInsights",
112-
"description": "adding a new logger with system-assigned managed identity",
112+
"description": "Application Insights logger with system-assigned managed identity",
113113
"credentials": {
114114
"connectionString":"InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/;...",
115115
"identityClientId":"SystemAssigned"
@@ -159,7 +159,7 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
159159
}
160160
```
161161
---
162-
#### User-assigned managed identity and connection string
162+
#### Connection string with user-assigned managed identity
163163

164164
#### [REST API](#tab/rest)
165165

@@ -169,7 +169,7 @@ Use the API Management [Logger - Create or Update](/rest/api/apimanagement/curre
169169
{
170170
"properties": {
171171
"loggerType": "applicationInsights",
172-
"description": "adding a new logger with user-assigned managed identity",
172+
"description": "Application Insights logger with user-assigned managed identity",
173173
"credentials": {
174174
"connectionString":"InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/;...",
175175
"identityClientId":"<ClientID>"
@@ -234,7 +234,7 @@ If you are configuring the logger for a workspace, use the [Workspace Logger - C
234234
{
235235
"properties": {
236236
"loggerType": "applicationInsights",
237-
"description": "adding a new logger with connection string",
237+
"description": "Application Insights logger with connection string",
238238
"credentials": {
239239
"connectionString":"InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/;..."
240240
}
@@ -246,6 +246,9 @@ If you are configuring the logger for a workspace, use the [Workspace Logger - C
246246

247247
Include a snippet similar to the following in your Bicep template.
248248

249+
If you are configuring the logger for a workspace, create a `Microsoft.ApiManagement/service.workspace/loggers@2023-09-01-preview` resource instead.
250+
251+
249252
```Bicep
250253
resource aiLoggerWithSystemAssignedIdentity 'Microsoft.ApiManagement/service/loggers@2022-08-01' = {
251254
name: 'ContosoLogger1'
@@ -264,6 +267,9 @@ resource aiLoggerWithSystemAssignedIdentity 'Microsoft.ApiManagement/service/log
264267

265268
Include a JSON snippet similar to the following in your Azure Resource Manager template.
266269

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.
271+
272+
267273
```JSON
268274
{
269275
"type": "Microsoft.ApiManagement/service/loggers",
@@ -335,7 +341,7 @@ Application Insights receives:
335341
> 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.
336342
337343
## 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.
339345

340346
> [!NOTE]
341347
> 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.
369375
370376
### Limits for custom metrics
371377
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).
373379
374380
These limits have the following implications for configuring custom metrics in API Management:
375381

articles/api-management/api-management-howto-log-event-hubs.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ To log events to the event hub, you need to configure credentials for access fro
3434
* A managed identity for your API Management instance (recommended)
3535
* An Event Hubs connection string
3636

37-
### Option 1: Configure API Management managed identity
38-
3937
> [!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
4142

4243
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.
4344

@@ -59,7 +60,7 @@ The next step is to configure a [logger](/rest/api/apimanagement/current-ga/logg
5960

6061
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.
6162

62-
### Logger with managed identity credentials (recommended)
63+
### Option 1: Logger with managed identity credentials (recommended)
6364

6465
You can configure an API Management logger to an event hub using either system-assigned or user-assigned managed identity credentials.
6566

@@ -69,13 +70,13 @@ For prerequisites, see [Configure API Management managed identity](#option-1-con
6970

7071
#### [REST API](#tab/PowerShell)
7172

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.
7374

7475
```JSON
7576
{
7677
"properties": {
7778
"loggerType": "azureEventHub",
78-
"description": "adding a new logger with system assigned managed identity",
79+
"description": "Event Hub logger with system-assigned managed identity",
7980
"credentials": {
8081
"endpointAddress":"<EventHubsNamespace>.servicebus.windows.net",
8182
"identityClientId":"SystemAssigned",
@@ -91,7 +92,7 @@ Use the API Management [REST API](/rest/api/apimanagement/current-preview/logger
9192
Include a snippet similar to the following in your Bicep template.
9293

9394
```Bicep
94-
resource ehLoggerWithSystemAssignedIdentity 'Microsoft.ApiManagement/service/loggers@2022-04-01-preview' = {
95+
resource ehLoggerWithSystemAssignedIdentity 'Microsoft.ApiManagement/service/loggers@2022-08-01' = {
9596
name: 'ContosoLogger1'
9697
parent: '<APIManagementInstanceName>'
9798
properties: {
@@ -113,11 +114,11 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
113114
```JSON
114115
{
115116
"type": "Microsoft.ApiManagement/service/loggers",
116-
"apiVersion": "2022-04-01-preview",
117+
"apiVersion": "2022-08-01",
117118
"name": "ContosoLogger1",
118119
"properties": {
119120
"loggerType": "azureEventHub",
120-
"description": "Event hub logger with system-assigned managed identity",
121+
"description": "Event Hub logger with system-assigned managed identity",
121122
"resourceId": "<EventHubsResourceID>",
122123
"credentials": {
123124
"endpointAddress": "<EventHubsNamespace>.servicebus.windows.net",
@@ -134,13 +135,14 @@ For prerequisites, see [Configure API Management managed identity](#option-1-con
134135

135136
#### [REST API](#tab/PowerShell)
136137

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+
138140

139141
```JSON
140142
{
141143
"properties": {
142144
"loggerType": "azureEventHub",
143-
"description": "adding a new logger with user-assigned managed identity",
145+
"description": "Event Hub logger with user-assigned managed identity",
144146
"credentials": {
145147
"endpointAddress":"<EventHubsNamespace>.servicebus.windows.net",
146148
"identityClientId":"<ClientID>",
@@ -153,15 +155,15 @@ Use the API Management [REST API](/rest/api/apimanagement/current-preview/logger
153155

154156
#### [Bicep](#tab/bicep)
155157

156-
Include a snippet similar the following in your Bicep template.
158+
Include a snippet similar to the following in your Bicep template.
157159

158160
```Bicep
159-
resource ehLoggerWithUserAssignedIdentity 'Microsoft.ApiManagement/service/loggers@2022-04-01-preview' = {
161+
resource ehLoggerWithUserAssignedIdentity 'Microsoft.ApiManagement/service/loggers@2022-08-01' = {
160162
name: 'ContosoLogger1'
161163
parent: '<APIManagementInstanceName>'
162164
properties: {
163165
loggerType: 'azureEventHub'
164-
description: 'Event hub logger with user-assigned managed identity'
166+
description: 'Event Hub logger with user-assigned managed identity'
165167
credentials: {
166168
endpointAddress: '<EventHubsNamespace>.servicebus.windows.net'
167169
identityClientId: '<ClientID>'
@@ -178,11 +180,11 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
178180
```JSON
179181
{
180182
"type": "Microsoft.ApiManagement/service/loggers",
181-
"apiVersion": "2022-04-01-preview",
183+
"apiVersion": "2022-08-01",
182184
"name": "ContosoLogger1",
183185
"properties": {
184186
"loggerType": "azureEventHub",
185-
"description": "Event hub logger with user-assigned managed identity",
187+
"description": "Event Hub logger with user-assigned managed identity",
186188
"resourceId": "<EventHubsResourceID>",
187189
"credentials": {
188190
"endpointAddress": "<EventHubsNamespace>.servicebus.windows.net",
@@ -195,7 +197,7 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
195197
---
196198

197199

198-
### Logger with connection string credentials
200+
### Option 2. Logger with connection string credentials
199201

200202
For prerequisites, see [Configure Event Hubs connection string](#option-2-configure-event-hubs-connection-string).
201203

@@ -221,12 +223,12 @@ New-AzApiManagementLogger -Context $context -LoggerId "ContosoLogger1" -Name "Ap
221223
Include a snippet similar to the following in your Bicep template.
222224

223225
```Bicep
224-
resource ehLoggerWithConnectionString 'Microsoft.ApiManagement/service/loggers@2022-04-01-preview' = {
226+
resource ehLoggerWithConnectionString 'Microsoft.ApiManagement/service/loggers@2022-08-01' = {
225227
name: 'ContosoLogger1'
226228
parent: '<APIManagementInstanceName>'
227229
properties: {
228230
loggerType: 'azureEventHub'
229-
description: 'Event hub logger with connection string'
231+
description: 'Event Hub logger with connection string credentials'
230232
credentials: {
231233
connectionString: 'Endpoint=sb://<EventHubsNamespace>.servicebus.windows.net/;SharedAccessKeyName=<KeyName>;SharedAccessKey=<key>'
232234
name: 'ApimEventHub'
@@ -242,11 +244,11 @@ Include a JSON snippet similar to the following in your Azure Resource Manager t
242244
```JSON
243245
{
244246
"type": "Microsoft.ApiManagement/service/loggers",
245-
"apiVersion": "2022-04-01-preview",
247+
"apiVersion": "2022-08-01",
246248
"name": "ContosoLogger1",
247249
"properties": {
248250
"loggerType": "azureEventHub",
249-
"description": "Event hub logger with connection string",
251+
"description": "Event Hub logger with connection string credentials",
250252
"resourceId": "<EventHubsResourceID>"
251253
"credentials": {
252254
"connectionString": "Endpoint=sb://<EventHubsNamespace>/;SharedAccessKeyName=<KeyName>;SharedAccessKey=<key>",

0 commit comments

Comments
 (0)