An open repo for Azure Monitor queries, workbooks, alerts and more
MIT License
1.02k
stars
441
forks
source link
Attempting to upload log data to Log Analytics using BinaryData, Upload failed with Exception: ManagedIdentityCredential authentication failed: Service request failed. #239
Error message:
[08/15/2024 09:41:12 > 1b8c15: INFO] Attempting to upload log data to Log Analytics using BinaryData...
[08/15/2024 09:41:13 > 1b8c15: INFO] Upload failed with Exception: ManagedIdentityCredential authentication failed: Service request failed.
[08/15/2024 09:41:13 > 1b8c15: INFO] Status: 400 (Bad Request)
[08/15/2024 09:41:13 > 1b8c15: INFO]
[08/15/2024 09:41:13 > 1b8c15: INFO] Content:
[08/15/2024 09:41:13 > 1b8c15: INFO] {"exceptionMessage":"AADSTS500011: The resource principal named https://monitor.azure.com/ was not found in the tenant named XXXXXXX. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 436de620-92b3-44d5-895c-5bf899941500 Correlation ID: af5ba56e-09fe-4df1-baed-ceefeb53629b Timestamp: 2024-08-15 09:41:13Z","errorCode":"invalid_resource","innerException":null,"statusCode":400,"message":null,"correlationId":"a3c2bb3f-8d93-448c-af1b-0e18a08f747f"}
[08/15/2024 09:41:13 > 1b8c15: INFO]
[08/15/2024 09:41:13 > 1b8c15: INFO] Headers:
[08/15/2024 09:41:13 > 1b8c15: INFO] Date: Thu, 15 Aug 2024 09:41:13 GMT
[08/15/2024 09:41:13 > 1b8c15: INFO] Server: Kestrel
[08/15/2024 09:41:13 > 1b8c15: INFO] Transfer-Encoding: chunked
[08/15/2024 09:41:13 > 1b8c15: INFO] X-CORRELATION-ID: REDACTED
[08/15/2024 09:41:13 > 1b8c15: INFO] Content-Type: application/json; charset=utf-8
[08/15/2024 09:41:13 > 1b8c15: INFO]
[08/15/2024 09:41:13 > 1b8c15: INFO] See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/managedidentitycredential/troubleshoot
[08/15/2024 09:41:13 > 1b8c15: INFO] Attempting to upload log data to Log Analytics using list...
[08/15/2024 09:41:13 > 1b8c15: INFO] Upload failed with Exception: 1 out of the 1 logs failed to upload. Please check the InnerExceptions for more details. (ManagedIdentityCredential authentication failed: Service request failed.
why error message show resource principal named https://monitor.azure.com/ , because this is a azure China cloud tenant.
what is the Azure monitor endpoint in Azure China, var endpoint = new Uri("https://my-url.monitor.azure.cn")
is there a sample for azure china to upload the custom log to Azure Monitor
Error message: [08/15/2024 09:41:12 > 1b8c15: INFO] Attempting to upload log data to Log Analytics using BinaryData... [08/15/2024 09:41:13 > 1b8c15: INFO] Upload failed with Exception: ManagedIdentityCredential authentication failed: Service request failed. [08/15/2024 09:41:13 > 1b8c15: INFO] Status: 400 (Bad Request) [08/15/2024 09:41:13 > 1b8c15: INFO] [08/15/2024 09:41:13 > 1b8c15: INFO] Content: [08/15/2024 09:41:13 > 1b8c15: INFO] {"exceptionMessage":"AADSTS500011: The resource principal named https://monitor.azure.com/ was not found in the tenant named XXXXXXX. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 436de620-92b3-44d5-895c-5bf899941500 Correlation ID: af5ba56e-09fe-4df1-baed-ceefeb53629b Timestamp: 2024-08-15 09:41:13Z","errorCode":"invalid_resource","innerException":null,"statusCode":400,"message":null,"correlationId":"a3c2bb3f-8d93-448c-af1b-0e18a08f747f"} [08/15/2024 09:41:13 > 1b8c15: INFO] [08/15/2024 09:41:13 > 1b8c15: INFO] Headers: [08/15/2024 09:41:13 > 1b8c15: INFO] Date: Thu, 15 Aug 2024 09:41:13 GMT [08/15/2024 09:41:13 > 1b8c15: INFO] Server: Kestrel [08/15/2024 09:41:13 > 1b8c15: INFO] Transfer-Encoding: chunked [08/15/2024 09:41:13 > 1b8c15: INFO] X-CORRELATION-ID: REDACTED [08/15/2024 09:41:13 > 1b8c15: INFO] Content-Type: application/json; charset=utf-8 [08/15/2024 09:41:13 > 1b8c15: INFO] [08/15/2024 09:41:13 > 1b8c15: INFO] See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/managedidentitycredential/troubleshoot [08/15/2024 09:41:13 > 1b8c15: INFO] Attempting to upload log data to Log Analytics using list... [08/15/2024 09:41:13 > 1b8c15: INFO] Upload failed with Exception: 1 out of the 1 logs failed to upload. Please check the InnerExceptions for more details. (ManagedIdentityCredential authentication failed: Service request failed.
refer to the document use Sample code to send data to Azure Monitor using Logs ingestion API : https://docs.azure.cn/en-us/azure-monitor/logs/tutorial-logs-ingestion-code?tabs=net
why error message show resource principal named https://monitor.azure.com/ , because this is a azure China cloud tenant. what is the Azure monitor endpoint in Azure China, var endpoint = new Uri("https://my-url.monitor.azure.cn") is there a sample for azure china to upload the custom log to Azure Monitor