-
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
{Synapse} Set credential_scopes
when creating clients
#30788
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
credential_scopes
when creating clientscredential_scopes
when creating clients
Thank you for your contribution! We will review the pull request and get back to you soon. |
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>
|
return SparkClient( | ||
credential=cred, | ||
endpoint='{}{}{}'.format("https://", workspace_name, cli_ctx.cloud.suffixes.synapse_analytics_endpoint), | ||
spark_pool_name=sparkpool_name | ||
spark_pool_name=sparkpool_name, | ||
credential_scopes=resource_to_scopes(cli_ctx.cloud.endpoints.synapse_analytics_resource_id) |
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.
SparkClient
's handling of credential_scopes
is wrong.
In azure.synapse.spark._configuration.SparkClientConfiguration.__init__
self.credential_scopes = ['https://dev.azuresynapse.net/.default']
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
credential_scopes
is added to the existing ['https://dev.azuresynapse.net/.default']
, instead of replacing it. See Azure/autorest.python#745.
#29690 dropped support for this incorrect usage.
AccessControlClient
, ArtifactsClient
, VnetClient
are correct.
dffed0c
to
8b9e3c2
Compare
8b9e3c2
to
9f8a5a8
Compare
Related command
Description
credential_scopes
is not set when creatingazure.synapse
clients.This will cause failure in sovereign clouds as different clouds have different
synapse_analytics_resource_id
:azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 378 in 5814523
azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 414 in 5814523
azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 445 in 5814523