Skip to content

Commit 84d56b4

Browse files
authored
Merge pull request #116453 from mavaddat/patch-1
Update azure-ad-authentication.md
2 parents 0ba1783 + 31bb021 commit 84d56b4

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

articles/azure-monitor/app/azure-ad-authentication.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,33 @@ ms.reviewer: rijolly
1111

1212
Application Insights now supports [Microsoft Entra authentication](../../active-directory/authentication/overview-authentication.md). By using Microsoft Entra ID, you can ensure that only authenticated telemetry is ingested in your Application Insights resources.
1313

14-
Using various authentication systems can be cumbersome and risky because it's difficult to manage credentials at scale. You can now choose to [opt out of local authentication](#disable-local-authentication) to ensure only telemetry exclusively authenticated by using [managed identities](../../active-directory/managed-identities-azure-resources/overview.md) and [Microsoft Entra ID](../../active-directory/fundamentals/active-directory-whatis.md) is ingested in your resource. This feature is a step to enhance the security and reliability of the telemetry used to make critical operational ([alerting](../alerts/alerts-overview.md#what-are-azure-monitor-alerts)and [autoscale](../autoscale/autoscale-overview.md#overview-of-autoscale-in-azure)) and business decisions.
14+
Using various authentication systems can be cumbersome and risky because it's difficult to manage credentials at scale. You can now choose to [opt out of local authentication](#disable-local-authentication) to ensure only telemetry exclusively authenticated by using [managed identities](../../active-directory/managed-identities-azure-resources/overview.md) and [Microsoft Entra ID](../../active-directory/fundamentals/active-directory-whatis.md) is ingested in your resource. This feature is a step to enhance the security and reliability of the telemetry used to make critical operational ([alerting](../alerts/alerts-overview.md#what-are-azure-monitor-alerts) and [autoscaling](../autoscale/autoscale-overview.md#overview-of-autoscale-in-azure)) and business decisions.
1515

1616
> [!NOTE]
17-
> Note
18-
> This document covers data ingestion into Application Insights using Microsoft Entra ID. authentication. For information on querying data within Application Insights, see [Query Application Insights using Microsoft Entra authentication](./app-insights-azure-ad-api.md).
17+
> This document covers data ingestion into Application Insights using Microsoft Entra ID-based authentication. For information on querying data within Application Insights, see [Query Application Insights using Microsoft Entra authentication](./app-insights-azure-ad-api.md).
1918
2019
## Prerequisites
21-
>
2220

23-
The following prerequisites enable Microsoft Entra authenticated ingestion. You need to:
21+
The following preliminary steps are required to enable Microsoft Entra authenticated ingestion. You need to:
2422

2523
- Be in the public cloud.
26-
- Have familiarity with:
27-
- [Managed identity](../../active-directory/managed-identities-azure-resources/overview.md).
28-
- [Service principal](../../active-directory/develop/howto-create-service-principal-portal.md).
29-
- [Assigning Azure roles](../../role-based-access-control/role-assignments-portal.md).
24+
- Be familiar with:
25+
- [Managed identity](../../active-directory/managed-identities-azure-resources/overview.md).
26+
- [Service principal](../../active-directory/develop/howto-create-service-principal-portal.md).
27+
- [Assigning Azure roles](../../role-based-access-control/role-assignments-portal.md).
3028
- Have an Owner role to the resource group to grant access by using [Azure built-in roles](../../role-based-access-control/built-in-roles.md).
3129
- Understand the [unsupported scenarios](#unsupported-scenarios).
3230

3331
## Unsupported scenarios
3432

3533
The following SDKs and features are unsupported for use with Microsoft Entra authenticated ingestion:
3634

37-
- [Application Insights Java 2.x SDK](deprecated-java-2x.md#monitor-dependencies-caught-exceptions-and-method-execution-times-in-java-web-apps).<br>
35+
- [Application Insights Java 2.x SDK](deprecated-java-2x.md#monitor-dependencies-caught-exceptions-and-method-execution-times-in-java-web-apps).<br />
3836
Microsoft Entra authentication is only available for Application Insights Java Agent greater than or equal to 3.2.0.
3937
- [ApplicationInsights JavaScript web SDK](javascript.md).
4038
- [Application Insights OpenCensus Python SDK](/previous-versions/azure/azure-monitor/app/opencensus-python) with Python version 3.4 and 3.5.
4139
- [Certificate/secret-based Microsoft Entra ID](../../active-directory/authentication/active-directory-certificate-based-authentication-get-started.md) isn't recommended for production. Use managed identities instead.
42-
- On-by-default codeless monitoring (for languages) for Azure App Service, Azure Virtual Machines/Azure Virtual Machine Scale Sets, and Azure Functions.
40+
- On-by-default [autoinstrumentation/codeless monitoring](codeless-overview.md) (for languages) for Azure App Service, Azure Virtual Machines/Azure Virtual Machine Scale Sets, and Azure Functions.
4341
- [Availability tests](availability-overview.md).
4442
- [Profiler](profiler-overview.md).
4543

@@ -75,10 +73,10 @@ Application Insights .NET SDK supports the credential classes provided by [Azure
7573

7674
- We recommend `DefaultAzureCredential` for local development.
7775
- We recommend `ManagedIdentityCredential` for system-assigned and user-assigned managed identities.
78-
- For system-assigned, use the default constructor without parameters.
79-
- For user-assigned, provide the client ID to the constructor.
76+
- For system-assigned, use the default constructor without parameters.
77+
- For user-assigned, provide the client ID to the constructor.
8078
- We recommend `ClientSecretCredential` for service principals.
81-
- Provide the tenant ID, client ID, and client secret to the constructor.
79+
- Provide the tenant ID, client ID, and client secret to the constructor.
8280

8381
The following example shows how to manually create and configure `TelemetryConfiguration` by using .NET:
8482

@@ -150,7 +148,7 @@ appInsights.defaultClient.config.aadTokenCredential = credential;
150148
1. Add the JSON configuration to the *ApplicationInsights.json* configuration file depending on the authentication you're using. We recommend using managed identities.
151149

152150
> [!NOTE]
153-
> For more information about migrating from the 2.X SDK to the 3.X Java agent, see [Upgrading from Application Insights Java 2.x SDK](java-standalone-upgrade-from-2x.md).
151+
> For more information about migrating from the `2.X` SDK to the `3.X` Java agent, see [Upgrading from Application Insights Java 2.x SDK](java-standalone-upgrade-from-2x.md).
154152
155153
#### System-assigned managed identity
156154

@@ -180,6 +178,7 @@ The following example shows how to configure the Java agent to use user-assigned
180178
}
181179
}
182180
```
181+
183182
:::image type="content" source="media/azure-ad-authentication/user-assigned-managed-identity.png" alt-text="Screenshot that shows user-assigned managed identity." lightbox="media/azure-ad-authentication/user-assigned-managed-identity.png":::
184183

185184
#### Client secret
@@ -198,6 +197,7 @@ The following example shows how to configure the Java agent to use a service pri
198197
}
199198
}
200199
```
200+
201201
:::image type="content" source="media/azure-ad-authentication/client-secret-tenant-id.png" alt-text="Screenshot that shows the client secret with the tenant ID and the client ID." lightbox="media/azure-ad-authentication/client-secret-tenant-id.png":::
202202

203203
:::image type="content" source="media/azure-ad-authentication/client-secret-cs.png" alt-text="Screenshot that shows the Client secrets section with the client secret." lightbox="media/azure-ad-authentication/client-secret-cs.png":::
@@ -206,17 +206,17 @@ The following example shows how to configure the Java agent to use a service pri
206206

207207
The `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable lets Application Insights authenticate to Microsoft Entra ID and send telemetry.
208208

209-
- For system-assigned identity:
209+
- For system-assigned identity:
210210

211-
| App setting | Value |
212-
| -------------- |--------- |
213-
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD` |
211+
| App setting | Value |
212+
| -------------- |--------- |
213+
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD` |
214214

215-
- For user-assigned identity:
215+
- For user-assigned identity:
216216

217-
| App setting | Value |
218-
| ------------- | -------- |
219-
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD;ClientId={Client id of the User-Assigned Identity}` |
217+
| App setting | Value |
218+
| ------------- | -------- |
219+
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD;ClientId={Client id of the User-Assigned Identity}` |
220220

221221
Set the `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable using this string.
222222

@@ -242,7 +242,7 @@ is included starting with beta version [opencensus-ext-azure 1.1b0](https://pypi
242242

243243
Construct the appropriate [credentials](/python/api/overview/azure/identity-readme#credentials) and pass them into the constructor of the Azure Monitor exporter. Make sure your connection string is set up with the instrumentation key and ingestion endpoint of your resource.
244244

245-
The `OpenCensus`` Azure Monitor exporters support these authentication types. We recommend using managed identities in production environments.
245+
The `OpenCensus` Azure Monitor exporters support these authentication types. We recommend using managed identities in production environments.
246246

247247
#### System-assigned managed identity
248248

@@ -300,6 +300,7 @@ tracer = Tracer(
300300
)
301301
...
302302
```
303+
303304
---
304305

305306
## Disable local authentication
@@ -444,7 +445,7 @@ When developing a custom client to obtain an access token from Microsoft Entra I
444445

445446
If you're using sovereign clouds, you can find the audience information in the connection string as well. The connection string follows this structure:
446447

447-
_InstrumentationKey={profile.InstrumentationKey};IngestionEndpoint={ingestionEndpoint};LiveEndpoint={liveDiagnosticsEndpoint};AADAudience={aadAudience}_
448+
*InstrumentationKey={profile.InstrumentationKey};IngestionEndpoint={ingestionEndpoint};LiveEndpoint={liveDiagnosticsEndpoint};AADAudience={aadAudience}*
448449

449450
The audience parameter, AADAudience, may vary depending on your specific environment.
450451

@@ -486,7 +487,7 @@ Next, you should review the Application Insights resource's access control. The
486487
The Application Insights .NET SDK emits error logs by using the event source. To learn more about collecting event source logs, see [Troubleshooting no data - collect logs with PerfView](asp-net-troubleshoot-no-data.md#PerfView).
487488

488489
If the SDK fails to get a token, the exception message is logged as
489-
`Failed to get AAD Token. Error message: `.
490+
`Failed to get AAD Token. Error message:`.
490491

491492
### [Node.js](#tab/nodejs)
492493

@@ -531,6 +532,7 @@ If the following WARN message is seen in the log file `WARN c.m.a.TelemetryChann
531532
If you're using Fiddler, you might see the response header `HTTP/1.1 403 Forbidden - provided credentials do not grant the access to ingest the telemetry into the component`.
532533

533534
The root cause might be one of the following reasons:
535+
534536
- You've created the resource with a system-assigned managed identity or associated a user-assigned identity with it. However, you might have forgotten to add the Monitoring Metrics Publisher role to the resource (if using SAMI) or the user-assigned identity (if using UAMI).
535537
- You've provided the right credentials to get the access tokens, but the credentials don't belong to the right Application Insights resource. Make sure you see your resource (VM or app service) or user-assigned identity with Monitoring Metrics Publisher roles in your Application Insights resource.
536538

@@ -567,8 +569,9 @@ You're probably missing a credential or your credential is set to `None`, but yo
567569
This error usually occurs when the provided credentials don't grant access to ingest telemetry for the Application Insights resource. Make sure your Application Insights resource has the correct role assignments.
568570

569571
---
572+
570573
## Next steps
571574

572-
* [Monitor your telemetry in the portal](overview-dashboard.md)
573-
* [Diagnose with Live Metrics Stream](live-stream.md)
574-
* [Query Application Insights using Microsoft Entra authentication](./app-insights-azure-ad-api.md)
575+
- [Monitor your telemetry in the portal](overview-dashboard.md)
576+
- [Diagnose with Live Metrics Stream](live-stream.md)
577+
- [Query Application Insights using Microsoft Entra authentication](./app-insights-azure-ad-api.md)

0 commit comments

Comments
 (0)