-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{dls} Set scopes when creating AzureDLFileSystem
#30786
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,9 +25,11 @@ def cf_dls_account_trusted_provider(cli_ctx, _): | |
| def cf_dls_filesystem(cli_ctx, account_name): | ||
| from azure.datalake.store import core | ||
| from azure.cli.core._profile import Profile | ||
| from azure.cli.core.auth.util import resource_to_scopes | ||
|
|
||
| cred, _, _ = Profile(cli_ctx=cli_ctx).get_login_credentials() | ||
| return core.AzureDLFileSystem( | ||
| token_credential=cred, | ||
| 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]) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The naming of Also, according to 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 |
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It is weird that
active_directory_data_lake_resource_idis only defined inAzureCloud:azure-cli/src/azure-cli-core/azure/cli/core/cloud.py
Line 371 in d1a5844
Does this mean dls doesn't support sovereign clouds at all?
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.
Then should we use
to avoid crush on sovereign clouds?
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.
Before #30770,
resource=cli_ctx.cloud.endpoints.active_directory_data_lake_resource_idis passed toprofile.get_login_credentialsunconditionally.