Open atwoodtja opened 3 years ago
account
Ok, I was able to get this working. There are two typos in the credential_scopes examples given for AzureChinaCloud in the page linked in Reproduce steps (https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-sovereign-domain).
The scope needs a / after the host url and should not have a ' at the end.
This works: credential_scopes=[AZURE_CHINA_CLOUD.endpoints.resource_manager + "/.default"]
This does not: credential_scopes=[AZURE_CHINA_CLOUD.endpoints.resource_manager + ".default'"]
The argument needs to be used for any auth *Client (ResourceManagementClient, ComputeManagementClient, NetworkManagementClient, StorageManagementClient, etc).
@atwoodtja, thanks for reporting this issue. You have identified the root cause precisely.
Azure CLI internally is using the correct method to do resource -> scopes conversion:
I will do some testing and submit a PR to fix the doc.
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az account get-access-token
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
Using code changes for login suggested in https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-sovereign-domain
az account get-access-token --output {} --resource {}
Expected Behavior
Environment Summary
Additional Context