Skip to content

Commit e3edb2a

Browse files
committed
batch-credential-scopes
1 parent 5814523 commit e3edb2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/azure-cli/azure/cli/command_modules/batch/_client_factory.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def batch_data_client_factory(cli_ctx, kwargs):
5050

5151
if not token_credential and not account_key:
5252
from azure.cli.core._profile import Profile
53+
from azure.cli.core.auth.util import resource_to_scopes
5354
profile = Profile(cli_ctx=cli_ctx)
54-
resource = cli_ctx.cloud.endpoints.batch_resource_id
55-
token_credential, _, _ = profile.get_login_credentials(resource=resource)
55+
token_credential, _, _ = profile.get_login_credentials()
5656

5757
if account_key:
5858
from azure.core.credentials import AzureNamedKeyCredential
@@ -64,4 +64,5 @@ def batch_data_client_factory(cli_ctx, kwargs):
6464
account_endpoint.startswith('http://')):
6565
account_endpoint = 'https://' + account_endpoint
6666

67-
return BatchClient(credential=credential, endpoint=account_endpoint.rstrip('/'))
67+
return BatchClient(credential=credential, endpoint=account_endpoint.rstrip('/'),
68+
credential_scopes=resource_to_scopes(cli_ctx.cloud.endpoints.batch_resource_id))

0 commit comments

Comments
 (0)