Skip to content

Commit 250dc89

Browse files
committed
Changing doc
1 parent b4d4b38 commit 250dc89

3 files changed

Lines changed: 121 additions & 130 deletions

File tree

support/azure/azure-monitor/app-insights/telemetry/investigate-missing-telemetry.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,121 @@ If tests performed by using PowerShell or curl fail to send telemetry to the ing
285285
- The ingestion endpoint that the SDK connects to may require TLS 1.2, but your application may by default use TLS 1.0 or TLS 1.1.
286286
- You may have more than one [Azure Monitor Private Link](/azure/azure-monitor/logs/private-link-security) impacting your private network, which may overwrite your DNS entries to resolve the ingestion endpoint to the wrong private IP address.
287287
288+
## Troubleshooting Microsoft Entra authentication issues
289+
290+
This article provides distinct troubleshooting scenarios and steps to resolve a [Microsoft Entra authentication](/azure/azure-monitor/app/azure-ad-authentication) issue before raising a support ticket.
291+
292+
### Ingestion HTTP errors
293+
294+
The ingestion service returns specific errors, regardless of the SDK language. Network traffic can be collected by using a tool such as Fiddler. You should filter traffic to the ingestion endpoint set in the connection string.
295+
296+
### HTTP/1.1 400 Authentication not supported
297+
298+
This error shows the resource is set for Microsoft Entra-only.
299+
300+
Review and correctly configure the SDK because it's sending to the wrong API.
301+
302+
> [!NOTE]
303+
> `v2/track` doesn't support Microsoft Entra ID. When the SDK is correctly configured, telemetry is sent to `v2.1/track`.
304+
305+
#### HTTP/1.1 401 Authorization required
306+
307+
This error indicates that the SDK is correctly configured but it's unable to acquire a valid token. This error might indicate an issue with Microsoft Entra ID.
308+
309+
Identify exceptions in the SDK logs or network errors from Azure Identity.
310+
311+
#### HTTP/1.1 403 Unauthorized
312+
313+
This error means the SDK uses credentials without permission for the Application Insights resource or subscription.
314+
315+
Check the Application Insights resource's access control. You must configure the SDK with credentials that have the Monitoring Metrics Publisher role.
316+
317+
### Language-specific troubleshooting
318+
319+
### [.NET](#tab/net)
320+
321+
#### Event source
322+
323+
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).
324+
325+
If the SDK fails to get a token, the exception message is logged as `Failed to get AAD Token. Error message:`.
326+
327+
### [Java](#tab/java)
328+
329+
#### HTTP traffic
330+
331+
You can inspect network traffic by using a tool like Fiddler. To enable the traffic to tunnel through Fiddler, either add the following proxy settings in the configuration file:
332+
333+
```JSON
334+
"proxy": {
335+
"host": "localhost",
336+
"port": 8888
337+
}
338+
```
339+
340+
Or add the following Java Virtual Machine (JVM) args while running your application: `-Djava.net.useSystemProxies=true -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8888`
341+
342+
If Microsoft Entra ID is enabled in the agent, outbound traffic includes the HTTP header `Authorization`.
343+
344+
#### 401 Unauthorized
345+
346+
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.
347+
348+
If you're using Fiddler, you might see the response header `HTTP/1.1 401 Unauthorized - please provide the valid authorization token`.
349+
350+
#### CredentialUnavailableException
351+
352+
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.
353+
354+
#### Failed to send telemetry
355+
356+
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.
357+
358+
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`.
359+
360+
The issue could be due to:
361+
362+
* Creating the resource with a system-assigned managed identity or associating a user-assigned identity without adding the Monitoring Metrics Publisher role to it.
363+
* 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.
364+
365+
#### Invalid Client ID
366+
367+
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.
368+
369+
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.
370+
371+
### [Java native](#tab/java-native)
372+
373+
> [!NOTE]
374+
> Microsoft Entra ID authentication isn't available for *GraalVM Native* applications.
375+
376+
### [Node.js](#tab/nodejs)
377+
378+
Turn on internal logs by using the following setup. After you enable them, the console shows error logs, including any error related to Microsoft Entra integration. Examples include failing to generate the token with the wrong credentials or errors when the ingestion endpoint fails to authenticate using the provided credentials.
379+
380+
```javascript
381+
let appInsights = require("applicationinsights");
382+
appInsights.setup("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/").setInternalLogging(true, true);
383+
```
384+
385+
### [Python](#tab/python)
386+
387+
### Error starts with "credential error" (with no status code)
388+
389+
Something is incorrect about the credential you're using and the client isn't able to obtain a token for authorization. It's because the required data is lacking for the state. An example would be passing in a system `ManagedIdentityCredential` but the resource isn't configured to use system-managed identity.
390+
391+
### Error starts with "authentication error" (with no status code)
392+
393+
The client failed to authenticate with the given credential. This error usually occurs when the credential used doesn't have the correct role assignments.
394+
395+
### I'm getting a status code 400 in my error logs
396+
397+
You're probably missing a credential or your credential is set to `None`, 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.
398+
399+
### I'm getting a status code 403 in my error logs
400+
401+
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.
402+
403+
---
404+
288405
[!INCLUDE [Azure Help Support](../../../../includes/azure-help-support.md)]

support/azure/azure-monitor/app-insights/troubleshoot-microsoft-entra-authentication.md

Lines changed: 0 additions & 124 deletions
This file was deleted.

support/azure/azure-monitor/toc.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
items:
22
- name: Troubleshoot Azure Monitor
33
href: welcome-azure-monitor.yml
4-
54
- name: Activity Logs
65
items:
76
- name: I can't configure export of Activity Logs
@@ -103,17 +102,12 @@ items:
103102
href: app-insights/agent/status-monitor-v2-troubleshoot.md
104103
- name: Troubleshoot Azure Monitor's Change Analysis
105104
href: app-insights/agent/change-analysis-troubleshoot.md
106-
- name: Microsoft Entra authentication
107-
href: app-insights/troubleshoot-microsoft-entra-authentication.md
108-
109105
- name: Log Analytics
110106
items:
111107
- name: Configure and Manage Log analytics tables
112108
items:
113109
- name: Understand and mitigate high data consumption in Log Analytics
114110
href: log-analytics/configure-and-manage-log-analytics-tables/understand-and-mitigate-high-data-consumption-log-analytics.md
115-
- name: Tables aren't populated in a DNS solution that's deployed to a workspace
116-
href: log-analytics/configure-and-manage-log-analytics-tables/troubleshoot-dns-table-issues.md
117111
- name: Troubleshoot custom table creation errors in Azure
118112
href: log-analytics/configure-and-manage-log-analytics-tables/troubleshoot-custom-table-creation-errors.md
119113
- name: Troubleshoot custom log table creation in Azure
@@ -142,12 +136,16 @@ items:
142136
href: log-analytics/billing/why-daily-cap-exceeded.md
143137
- name: Configure data retention
144138
href: log-analytics/billing/configure-data-retention.md
139+
140+
141+
145142
- name: Linux Agents
146143
items:
147144
- name: Missing heartbeats in the Linux agent
148145
href: log-analytics/linux-agents/linux-agent-missing-heartbeats.md
149146
- name: Missing Linux performance counters
150147
href: log-analytics/linux-agents/linux-agent-performance-counter-missing.md
148+
151149
- name: Windows Agents
152150
items:
153151
- name: Basic troubleshooting of Microsoft Monitoring Agent

0 commit comments

Comments
 (0)