-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
Azure.Identity invokes AzureCLI for token requests in its AzureCliCredential implementation. I am wondering if there is a way to invoke az account get-access-token to get a token for Azure Graph with multiple scopes. In the comment of this issue, I tried it a few different ways and it wasn't clear how it can be done.
Currently in Azure.Identity, we only allow a single scope and pass it to the --resource switch on the CLI. But if we wanted to allow multiple scopes, it is unclear how we would call the CLI to do this. Is it true that this is not possible, or is there a syntax that would work here?
Related command
az account get-access-token
Errors
Status: Response_Status.Status_IncorrectConfiguration, Error code: 3399614471, Tag: 508634083
Please explicitly log in with:
az login --scope https://graph.microsoft.com/.default User.Read
Issue script & Debug output
n/a
Expected behavior
CLI can fetch a token for multiple scopes.
Environment Summary
azure-cli 2.67.0 *
core 2.67.0 *
telemetry 1.1.0
Extensions:
azure-dev 0.0.1b1532057
azure-devops 1.0.1
serial-console 0.1.6
ssh 2.0.2
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\chriss.azure\cliextensions'
Python (Windows) 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 02:44:45) [MSC v.1941 32 bit (Intel)]
Additional context
No response