{dls} Set scopes when creating AzureDLFileSystem#30786
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. |
| store_name=account_name, | ||
| url_suffix=cli_ctx.cloud.suffixes.azure_datalake_store_file_system_endpoint) | ||
| url_suffix=cli_ctx.cloud.suffixes.azure_datalake_store_file_system_endpoint, | ||
| scopes=resource_to_scopes(cli_ctx.cloud.endpoints.active_directory_data_lake_resource_id)[0]) |
There was a problem hiding this comment.
It is weird that active_directory_data_lake_resource_id is only defined in AzureCloud:
Does this mean dls doesn't support sovereign clouds at all?
There was a problem hiding this comment.
Then should we use
scopes=resource_to_scopes(cli_ctx.cloud.endpoints.active_directory_data_lake_resource_id)[0] if cli_ctx.cloud.endpoints.active_directory_data_lake_resource_id else None
to avoid crush on sovereign clouds?
There was a problem hiding this comment.
Before #30770, resource=cli_ctx.cloud.endpoints.active_directory_data_lake_resource_id is passed to profile.get_login_credentials unconditionally.
| store_name=account_name, | ||
| url_suffix=cli_ctx.cloud.suffixes.azure_datalake_store_file_system_endpoint) | ||
| url_suffix=cli_ctx.cloud.suffixes.azure_datalake_store_file_system_endpoint, | ||
| scopes=resource_to_scopes(cli_ctx.cloud.endpoints.active_directory_data_lake_resource_id)[0]) |
There was a problem hiding this comment.
The naming of scopes doesn't align with Track 2 mgmt SDKs where its equivalent is called credential_scopes.
Also, according to azure.datalake.store.lib.DatalakeRESTInterface.__init__
def __init__(self, store_name=default_store, token_credential=None, scopes=None, url_suffix=default_adls_suffix, **kwargs):
# in the case where an empty string is passed for the url suffix, it must be replaced with the default.
url_suffix = url_suffix or default_adls_suffix
self.local = threading.local()
self.token_credential = token_credential
self.scopes = scopes or "https://datalake.azure.net//.default"the value of scopes is a str, unlike credential_scopes's value which is a list[str].
Related command
Description
The Track 2 migration for
azure-datalake-storeSDK (#30770) is incomplete - it doesn't setscopeswhen creatingAzureDLFileSystem.