[BUG] AzureCliCredential incorrectly says that user is not logged in when authorizing without consent #26894
Labels
Azure.Identity
Client
This issue points to a problem in the data-plane of the library.
needs-team-attention
This issue needs attention from Azure service team or SDK team
Library name and version
Azure.Identity
Describe the bug
Result: the call fails with
Azure.Identity.CredentialUnavailableException
HResult=0x80131500
Message=Please run 'az login' to set up account"
Now do:
az account get-access-token --output json --resource api://<app_id>
You will get:
AADSTS65001: The user or administrator has not consented to use the application with ID '<app_id>' named 'Microsoft Azure CLI'. Send an interactive authorization request for this user and resource.
Expected behavior
Expected:
the error from GetToken should say something about the consent issue, not about login.
Actual behavior
Azure.Identity.CredentialUnavailableException
Reproduction Steps
see above
Environment
No response
The text was updated successfully, but these errors were encountered: