[BUG] AzureCliCredential - Misleading error message when blocked because of conditional access policy #29109
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.6
Describe the bug
If retrieving a token is blocked by conditional access policy, error message provided to the user ("Please run 'az login' to set up account") is misleading. In my case I can reproduce this running in a docker container and using scope "https://database.windows.net", running equivalent CLI command produces the following error message:
The last line matches the logged in check in the code.
Expected behavior
Better error message to help user diagnose the problem.
Actual behavior
Exception text says "Please run 'az login' to set up account"
See bug description
Reproduction Steps
Environment dependent,
Try getting a token that is blocked by conditional access policy.
Environment
In my scenario:
Image: mcr.microsoft.com/dotnet/aspnet:6.0
Azure.Identity 1.6
The text was updated successfully, but these errors were encountered: