-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{Batch} Set credential_scopes
when creating BatchClient
#30785
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
e3edb2a
to
f14133a
Compare
@@ -332,8 +332,7 @@ def validate_client_parameters(cmd, namespace): | |||
# check to see if we are using the default credentials | |||
from azure.cli.core._profile import Profile | |||
profile = Profile(cli_ctx=cmd.cli_ctx) | |||
resource = cmd.cli_ctx.cloud.endpoints.batch_resource_id | |||
token_credential, _, _ = profile.get_login_credentials(resource=resource) | |||
token_credential, _, _ = profile.get_login_credentials() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
token_credential
is not actually used to create a client, so specifying the resource
is unnecessary.
f14133a
to
2015434
Compare
Related command
az batch
Description
The Track 2 migration for
azure-batch
SDK (#30501) is incomplete - it doesn't setcredential_scopes
when creatingBatchClient
.This will cause failure in sovereign clouds as different clouds have different
batch_resource_id
:azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 365 in 5814523
azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 402 in 5814523
azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 433 in 5814523
azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 465 in 5814523