-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Can't connect to AppInsights with Azure.Monitor.Query with ManagedIdentity. #47295
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Hi @vpetit-reimagine - If deployed to Azure, can you get logging of the error while using the For console output, you would just need to add the following line to your program. using AzureEventSourceListener listener = AzureEventSourceListener.CreateTraceLogger(); If you need to log the output somewhere other than the console, this can be done as described in these docs. for example: using AzureEventSourceListener listener = new AzureEventSourceListener(
(args, message) => myLogger.Log("[{0:HH:mm:ss:fff}][{1}] {2}", DateTimeOffset.Now, args.Level, message),
level: EventLevel.Verbose); |
Hi @vpetit-reimagine. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
Hi christothes, I see in the logs on the deployed service that I have a If I look more closely, I see the following « The client with object id <client_id> does not have authorization to perform action 'Microsoft.Insights/metrics/read' over scope '/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Insights/components/{app-insights-resource}/providers/Microsoft.Insights' or the scope is invalid. If access was recently granted, please refresh your credentials."}}» I guess this means that some rights were not provided to the credentials. I will investigate further on that end and see if there is anything that was not properly configured. Do you see anything else I could investigate further just in case my intuition is false? |
Library name and version
Azure.Monitor.Query 1.5.0
Describe the bug
Following the example, it is impossible for an Azure Function to actually connect to the AppInsights through the package with
Expected behavior
The Azure Function should be able to read the Azure AppInsights it is trying to access to.
Actual behavior
Depending on what I am trying to test, I get either:
DefaultAzureCredential failed to retrieve a token from the included credentials.
new MetricsQueryClient(new ManagedIdentityCredential(id))
I getManagedIdentityCredential authentication failed: User-assigned managed identity is not supported by the detected managed identity environment.
(there is nothing in the documentation explaining whatReproduction Steps
Azure.Monitor.Query
andAzure.Identity
packages, specifying the previous app resource as the one to query (in the form of/subscriptions/{id}/resourceGroups/{rg-name}/providers/microsoft.insights/components/{app-insights-name}
).Environment
No response
The text was updated successfully, but these errors were encountered: