Skip to content

Commit a5b8795

Browse files
committed
Removing client secret information
1 parent 6be239b commit a5b8795

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
title: Microsoft Entra authentication for Application Insights
33
description: Learn how to enable Microsoft Entra authentication to ensure that only authenticated telemetry is ingested in your Application Insights resources.
44
ms.topic: conceptual
5-
ms.date: 11/15/2023
5+
ms.date: 04/01/2024
66
ms.devlang: csharp
7-
# ms.devlang: csharp, java, javascript, python
87
ms.reviewer: rijolly
98
---
109

@@ -26,12 +25,12 @@ The following preliminary steps are required to enable Microsoft Entra authentic
2625
- [Managed identity](../../active-directory/managed-identities-azure-resources/overview.md).
2726
- [Service principal](../../active-directory/develop/howto-create-service-principal-portal.md).
2827
- [Assigning Azure roles](../../role-based-access-control/role-assignments-portal.md).
29-
- 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).
28+
- Have an Owner role to the resource group if you want to grant access by using [Azure built-in roles](../../role-based-access-control/built-in-roles.md).
3029
- Understand the [unsupported scenarios](#unsupported-scenarios).
3130

3231
## Unsupported scenarios
3332

34-
The following SDKs and features are unsupported for use with Microsoft Entra authenticated ingestion:
33+
The following Software Development Kits (SDKs) and features are unsupported for use with Microsoft Entra authenticated ingestion:
3534

3635
- [Application Insights Java 2.x SDK](deprecated-java-2x.md#monitor-dependencies-caught-exceptions-and-method-execution-times-in-java-web-apps).<br />
3736
Microsoft Entra authentication is only available for Application Insights Java Agent greater than or equal to 3.2.0.
@@ -261,7 +260,7 @@ You can disable local authentication by using the Azure portal or Azure Policy o
261260

262261
:::image type="content" source="./media/azure-ad-authentication/disable.png" alt-text="Screenshot that shows local authentication with the Enabled/Disabled button.":::
263262

264-
1. After your resource has disabled local authentication, you'll see the corresponding information in the **Overview** pane.
263+
1. After disabling local authentication on your resource, you'll see the corresponding information in the **Overview** pane.
265264

266265
:::image type="content" source="./media/azure-ad-authentication/overview.png" alt-text="Screenshot that shows the Overview tab with the Disabled (select to change) local authentication button.":::
267266

@@ -389,7 +388,7 @@ If you're using sovereign clouds, you can find the audience information in the c
389388

390389
*InstrumentationKey={profile.InstrumentationKey};IngestionEndpoint={ingestionEndpoint};LiveEndpoint={liveDiagnosticsEndpoint};AADAudience={aadAudience}*
391390

392-
The audience parameter, AADAudience, may vary depending on your specific environment.
391+
The audience parameter, AADAudience, can vary depending on your specific environment.
393392

394393
## Troubleshooting
395394

@@ -401,7 +400,7 @@ The ingestion service returns specific errors, regardless of the SDK language. N
401400

402401
#### HTTP/1.1 400 Authentication not supported
403402

404-
This error indicates that the resource is configured for Microsoft Entra-only. The SDK hasn't been correctly configured and is sending to the incorrect API.
403+
This error shows the resource is set for Microsoft Entra-only. You need to correctly configure the SDK because it's sending to the wrong API.
405404

406405
> [!NOTE]
407406
> "v2/track" doesn't support Microsoft Entra ID. When the SDK is correctly configured, telemetry will be sent to "v2.1/track".
@@ -416,9 +415,9 @@ Next, you should identify exceptions in the SDK logs or network errors from Azur
416415

417416
#### HTTP/1.1 403 Unauthorized
418417

419-
This error indicates that the SDK is configured with credentials that haven't been given permission to the Application Insights resource or subscription.
418+
This error means the SDK uses credentials without permission for the Application Insights resource or subscription.
420419

421-
Next, you should review the Application Insights resource's access control. The SDK must be configured with a credential that's been granted the Monitoring Metrics Publisher role.
420+
First, check the Application Insights resource's access control. You must configure the SDK with credentials that have the Monitoring Metrics Publisher role.
422421

423422
### Language-specific troubleshooting
424423

@@ -453,30 +452,36 @@ You can inspect network traffic by using a tool like Fiddler. To enable the traf
453452
}
454453
```
455454

456-
Or add the following JVM args while running your application: `-Djava.net.useSystemProxies=true -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8888`
455+
Or add the following Java Virtual Machine (JVM) args while running your application: `-Djava.net.useSystemProxies=true -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8888`
457456

458457
If Microsoft Entra ID is enabled in the agent, outbound traffic includes the HTTP header `Authorization`.
459458

460459
#### 401 Unauthorized
461460

462-
If the following WARN message is seen in the log file `WARN c.m.a.TelemetryChannel - Failed to send telemetry with status code: 401, please check your credentials`, it indicates the agent wasn't successful in sending telemetry. You probably haven't enabled Microsoft Entra authentication on the agent, but your Application Insights resource is configured with `DisableLocalAuth: true`. Make sure you're passing in a valid credential and that it has permission to access your Application Insights resource.
461+
If you see the message, `WARN c.m.a.TelemetryChannel - Failed to send telemetry with status code: 401, please check your credentials` in the log, it means the agent couldn't send telemetry. You likely didn't enable Microsoft Entra authentication on the agent, while your Application Insights resource has `DisableLocalAuth: true`. Ensure you pass a valid credential with access permission to your Application Insights resource.
463462

464463
If you're using Fiddler, you might see the response header `HTTP/1.1 401 Unauthorized - please provide the valid authorization token`.
465464

466465
#### CredentialUnavailableException
467466

468-
If the following exception is seen in the log file `com.azure.identity.CredentialUnavailableException: ManagedIdentityCredential authentication unavailable. Connection to IMDS endpoint cannot be established`, it indicates the agent wasn't successful in acquiring the access token. The probable reason is that you've provided an invalid client ID in your User-Assigned Managed Identity configuration.
467+
If you see the exception, `com.azure.identity.CredentialUnavailableException: ManagedIdentityCredential authentication unavailable. Connection to IMDS endpoint cannot be established` in the log file, it means the agent failed to acquire the access token. The likely cause is an invalid client ID in your User-Assigned Managed Identity configuration.
469468

470469
#### Failed to send telemetry
471470

472-
If the following WARN message is seen in the log file `WARN c.m.a.TelemetryChannel - Failed to send telemetry with status code: 403, please check your credentials`, it indicates the agent wasn't successful in sending telemetry. This warning might be because the provided credentials don't grant access to ingest the telemetry into the component
471+
If you see the message, `WARN c.m.a.TelemetryChannel - Failed to send telemetry with status code: 403, please check your credentials` in the log, it means the agent couldn't send telemetry. The likely reason is that the credentials used don't allow telemetry ingestion.
473472

474-
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`.
473+
Using Fiddler, you might notice the response `HTTP/1.1 403 Forbidden - provided credentials do not grant the access to ingest the telemetry into the component`.
475474

476-
The root cause might be one of the following reasons:
475+
The issue could be due to:
477476

478-
- 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).
479-
- 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.
477+
- Creating the resource with a system-assigned managed identity or associating a user-assigned identity without adding the Monitoring Metrics Publisher role to it.
478+
- Using the correct credentials for access tokens but linking them to the wrong Application Insights resource. Ensure your resource (virtual machine or app service) or user-assigned identity has Monitoring Metrics Publisher roles in your Application Insights resource.
479+
480+
#### Invalid Client ID
481+
482+
If the exception, `com.microsoft.aad.msal4j.MsalServiceException: Application with identifier <CLIENT_ID> was not found in the directory` in the log, it means the agent failed to get the access token. This exception likely happens because the client ID in your client secret configuration is invalid or incorrect.
483+
484+
This issue occurs if the administrator doesn't install the application or no tenant user consents to it. It also happens if you send your authentication request to the wrong tenant.
480485

481486
### [Python](#tab/python)
482487

0 commit comments

Comments
 (0)