Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,16 @@ def get_account_url(cli_ctx, account_name, service):
return "https://{}.{}.{}".format(account_name, service, storage_endpoint)


def _config_location_mode(kwargs, client_kwargs):
location_mode = kwargs.pop('location_mode', None)
if location_mode:
client_kwargs['_location_mode'] = location_mode
return client_kwargs


def cf_blob_service(cli_ctx, kwargs):
client_kwargs = _prepare_client_kwargs_track2(cli_ctx)
client_kwargs = _config_location_mode(kwargs, client_kwargs)
t_blob_service = get_sdk(cli_ctx, ResourceType.DATA_STORAGE_BLOB,
'_blob_service_client#BlobServiceClient')
connection_string = kwargs.pop('connection_string', None)
Expand Down Expand Up @@ -240,6 +248,7 @@ def cf_container_client(cli_ctx, kwargs):

def cf_adls_service(cli_ctx, kwargs):
client_kwargs = _prepare_client_kwargs_track2(cli_ctx)
client_kwargs = _config_location_mode(kwargs, client_kwargs)
t_adls_service = get_sdk(cli_ctx, ResourceType.DATA_STORAGE_FILEDATALAKE,
'_data_lake_service_client#DataLakeServiceClient')
connection_string = kwargs.pop('connection_string', None)
Expand All @@ -248,6 +257,10 @@ def cf_adls_service(cli_ctx, kwargs):
token_credential = kwargs.pop('token_credential', None)
sas_token = kwargs.pop('sas_token', None)

location_mode = kwargs.pop('location_mode', None)
if location_mode:
client_kwargs['_location_mode'] = location_mode

if connection_string:
return t_adls_service.from_connection_string(conn_str=connection_string, **client_kwargs)

Expand Down Expand Up @@ -276,6 +289,7 @@ def cf_or_policy(cli_ctx, _):

def cf_queue_service(cli_ctx, kwargs):
client_kwargs = _prepare_client_kwargs_track2(cli_ctx)
client_kwargs = _config_location_mode(kwargs, client_kwargs)
t_queue_service = get_sdk(cli_ctx, ResourceType.DATA_STORAGE_QUEUE, '_queue_service_client#QueueServiceClient')
connection_string = kwargs.pop('connection_string', None)
account_name = kwargs.pop('account_name', None)
Expand Down
Loading