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/azure-monitor/app/azure-ad-authentication.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,8 @@
2
2
title: Microsoft Entra authentication for Application Insights
3
3
description: Learn how to enable Microsoft Entra authentication to ensure that only authenticated telemetry is ingested in your Application Insights resources.
4
4
ms.topic: conceptual
5
-
ms.date: 11/15/2023
5
+
ms.date: 04/01/2024
6
6
ms.devlang: csharp
7
-
# ms.devlang: csharp, java, javascript, python
8
7
ms.reviewer: rijolly
9
8
---
10
9
@@ -26,12 +25,12 @@ The following preliminary steps are required to enable Microsoft Entra authentic
- 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).
30
29
- Understand the [unsupported scenarios](#unsupported-scenarios).
31
30
32
31
## Unsupported scenarios
33
32
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:
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
261
260
262
261
:::image type="content" source="./media/azure-ad-authentication/disable.png" alt-text="Screenshot that shows local authentication with the Enabled/Disabled button.":::
263
262
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.
265
264
266
265
:::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.":::
267
266
@@ -389,7 +388,7 @@ If you're using sovereign clouds, you can find the audience information in the c
The audience parameter, AADAudience, may vary depending on your specific environment.
391
+
The audience parameter, AADAudience, can vary depending on your specific environment.
393
392
394
393
## Troubleshooting
395
394
@@ -401,7 +400,7 @@ The ingestion service returns specific errors, regardless of the SDK language. N
401
400
402
401
#### HTTP/1.1 400 Authentication not supported
403
402
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.
405
404
406
405
> [!NOTE]
407
406
> "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
416
415
417
416
#### HTTP/1.1 403 Unauthorized
418
417
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.
420
419
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.
422
421
423
422
### Language-specific troubleshooting
424
423
@@ -453,30 +452,36 @@ You can inspect network traffic by using a tool like Fiddler. To enable the traf
453
452
}
454
453
```
455
454
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`
457
456
458
457
If Microsoft Entra ID is enabled in the agent, outbound traffic includes the HTTP header `Authorization`.
459
458
460
459
#### 401 Unauthorized
461
460
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.
463
462
464
463
If you're using Fiddler, you might see the response header `HTTP/1.1 401 Unauthorized - please provide the valid authorization token`.
465
464
466
465
#### CredentialUnavailableException
467
466
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.
469
468
470
469
#### Failed to send telemetry
471
470
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.
473
472
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`.
475
474
476
-
The root cause might be one of the following reasons:
475
+
The issue could be due to:
477
476
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.
0 commit comments