-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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] Azure.Identity.ManagedIdentitySource throws ArgumentNullException #47844
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Hi @pampua84 - Sorry you have hit this issue. Is this occurring locally in your development environment or when deployed? Would you mind enabling logging to show what the 401 response body looks like as well as the request that generated it? For console output, you would just need to add the following line to your program. using AzureEventSourceListener listener = AzureEventSourceListener.CreateTraceLogger(EventLevel.Verbose); 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 @pampua84. 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. |
H @christothes i, the issue occurred locally because when using the |
Could you provide the logging output from your repro? This will help to ensure we are able to diagnose and fix this issue properly. |
Hi @pampua84. 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, here is the logger output as you indicated:
|
The class where i get the error is: at row 92 |
Library name and version
Azure.Identity 1.13.2
Describe the bug
In my application, I'm trying to get a certificate from Azure Key Vault using this simple code:
However, I receive a 401 Unauthorized error without content in the Azure HTTP response, which raises the following exception:
It seems that the
ToString()
method is being called on a nullContent
object inside the library.Expected behavior
In the case of 401 I expect a speaking message or at least only the value Unauthorized
Actual behavior
Currently the following message is returned:
Reproduction Steps
Create simple unauthorided client to get certificate from Key Vault
Environment
.NET SDK:
Version: 9.0.101
Commit: eedb237549
Workload version: 9.0.100-manifests.4a280210
MSBuild version: 17.12.12+1cce77968
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.101\
The text was updated successfully, but these errors were encountered: