{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>
|
| 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.
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_scopesis not set when creatingazure.synapseclients.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