Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
628 stars 241 forks source link

Default/Selected (subscription, tenant, user) combination to be used to get an access token #1229

Open roshan-sy opened 2 years ago

roshan-sy commented 2 years ago

I don't think it is a good idea to try every Azure CLI account, as this may cause unexpected user credential to be used.

Instead, only the default/selected (subscription, tenant, user) combination should be used to get an access token. If that token doesn't have access, we should explicitly switch account with az account set.

Originally posted by @jiasli in https://github.com/Azure/azure-devops-cli-extension/issues/1226#issuecomment-963889338