Skip to content

Commit

Permalink
{dls} Set scopes when creating AzureDLFileSystem (#30786)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiasli authored Feb 12, 2025
1 parent 853ff0b commit 9979299
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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])

0 comments on commit 9979299

Please sign in to comment.