how to specify `scopes` and retrieve TokenCredential
See original GitHub issueHi team,
I’m trying to migrate our service from using deprecated msrestazure to Azure-identity.
I’m trying to figure out how to use the scopes
parameter in the Credential.
For example, I’m trying to use azure-identity for getting secrets from azure keyvault:
credentials = DefaultAzureCredential(scopes=‘https://vault.azure.net’) secret_client = SecretClient(vault_url=vault_base_url, credential=credential)
but it didn’t work It looks like the scopes parameter is only used by the get_token() method but it returns AccessToken class instead, which is not what I want.
In the previous library it provides a parameter resource
to specify what resource we are pointing to.
https://github.com/Azure/msrestazure-for-python/blob/698eb06bcbf9fda4c7ae04d929f7b5b955fcbfed/msrestazure/azure_active_directory.py#L567
Do you know how I can get a TokenCredential class and specify the scopes?
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)
Just a quick update, we tried to use the default scope and it works in both Public and Special clouds.
Sure, I’m working on an internal build to test with my new fix without explicitly specifying scopes. I will keep you posted.