Open vpetit-reimagine opened 1 day ago
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Hi @vpetit-reimagine - In your repro steps you mention running the Azure Function - are you running it locally or deployed to Azure?
If deployed to Azure, can you get logging of the error while using the ManagedIdentityCredential
?
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.
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