[BUG] ManagedIdentityCredential failure is not presented as a failure of one of the alternative credentials - it is presented as _the_ failure #32061
Labels
Azure.Identity
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Library name and version
Azure.Identity 1.7.0
Describe the bug
I'm just starting out with Azure Service Bus, and following the example of how to write a Sender to a Topic, using the Passwordless alternative approach (i.e. DefaultAzureCredential). I'm getting a AuthenticationFailedException ManagedIdentityCredential with an internal exception of "System.Text.Json.JsonReaderException: '<' is an invalid start of a value."...
I think the 403 GlobalBlock in the error below is something to do with a McAfee proxy, but I'm not sure.
The bug is that this issue is being allowed to hog the limelight, rather than being shown as one of the alternatives which didn't work.
Similar reported bugs #27477 #30467
Expected behavior
When I take the advice on (similar error) #27477 to set "ExcludeManagedIdentityCredential = true", then I get an error message which is actually helpful, listing out each of the alternative credentials and why that particular alternative isn't happy. I would have thought that a failure like this should be reported in the same way... i.e. here's the reason why all of the different approaches failed, including this issue from the ManagedIdentity approach; whereas, as you can see a beginner (like me) would have no clue from the details given below that this was just one of several alternatives that it was trying, and that I could even consider switching this off.
As soon as I switched it off, I could see from the helpful error that the actual issue was that my Visual Studio credentials needed to be re-entered, not that there was an issue with ManagedIdentity, which I had no interest in.
Actual behavior
The error is reported as if it is the failure. Rather than that it is one of several alternatives, and this is why this alternative failed.
Reproduction Steps
Follow the getting started article and code, and run the Sender program from Visual Studio when the ManagedIdentity returns 403 (for reasons I can't explain); and when you are expecting it to use your Visual Studio credentials, but you don't know that your credentials need to be re-entered. You'll get the error solely talking about ManagedIdentity, rather than an error saying we tried these various different ways, and here's how each of them failed. Which makes it look like this is a problem that you must sort out, whereas you could simply switch off this alternative.
Environment
Visual Studio 2022, .net 6 console app, Windows 10.
The text was updated successfully, but these errors were encountered: