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
8 changes: 8 additions & 0 deletions src/azure-cli/azure/cli/command_modules/storage/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
help='Commence only if unmodified since supplied UTC datetime (Y-m-d\'T\'H:M\'Z\')',
type=get_datetime_type(False))

allow_shared_key_access_type = CLIArgumentType(
arg_type=get_three_state_flag(), options_list=['--allow-shared-key-access', '-k'], min_api='2019-04-01',
help='Indicate whether the storage account permits requests to be authorized with the account access key via '
'Shared Key. If false, then all requests, including shared access signatures, must be authorized with '
'Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.')

with self.argument_context('storage') as c:
c.argument('container_name', container_name_type)
c.argument('directory_name', directory_type)
Expand Down Expand Up @@ -260,6 +266,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.argument('min_tls_version', arg_type=get_enum_type(t_tls_version),
help='The minimum TLS version to be permitted on requests to storage. '
'The default interpretation is TLS 1.0 for this property')
c.argument('allow_shared_key_access', allow_shared_key_access_type)

with self.argument_context('storage account private-endpoint-connection',
resource_type=ResourceType.MGMT_STORAGE) as c:
Expand Down Expand Up @@ -312,6 +319,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.argument('min_tls_version', arg_type=get_enum_type(t_tls_version),
help='The minimum TLS version to be permitted on requests to storage. '
'The default interpretation is TLS 1.0 for this property')
c.argument('allow_shared_key_access', allow_shared_key_access_type)

with self.argument_context('storage account update', arg_group='Customer managed key', min_api='2017-06-01') as c:
t_key_source = self.get_models('KeySource', resource_type=ResourceType.MGMT_STORAGE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def create_storage_account(cmd, resource_group_name, account_name, sku=None, loc
encryption_key_type_for_table=None, encryption_key_type_for_queue=None,
routing_choice=None, publish_microsoft_endpoints=None, publish_internet_endpoints=None,
require_infrastructure_encryption=None, allow_blob_public_access=None,
min_tls_version=None):
min_tls_version=None, allow_shared_key_access=None):
StorageAccountCreateParameters, Kind, Sku, CustomDomain, AccessTier, Identity, Encryption, NetworkRuleSet = \
cmd.get_models('StorageAccountCreateParameters', 'Kind', 'Sku', 'CustomDomain', 'AccessTier', 'Identity',
'Encryption', 'NetworkRuleSet')
Expand Down Expand Up @@ -134,6 +134,9 @@ def create_storage_account(cmd, resource_group_name, account_name, sku=None, loc
if min_tls_version:
params.minimum_tls_version = min_tls_version

if allow_shared_key_access is not None:
params.allow_shared_key_access = allow_shared_key_access

return scf.storage_accounts.begin_create(resource_group_name, account_name, params)


Expand Down Expand Up @@ -209,7 +212,7 @@ def update_storage_account(cmd, instance, sku=None, tags=None, custom_domain=Non
domain_name=None, net_bios_domain_name=None, forest_name=None, domain_guid=None,
domain_sid=None, azure_storage_sid=None, routing_choice=None,
publish_microsoft_endpoints=None, publish_internet_endpoints=None,
allow_blob_public_access=None, min_tls_version=None):
allow_blob_public_access=None, min_tls_version=None, allow_shared_key_access=None):
StorageAccountUpdateParameters, Sku, CustomDomain, AccessTier, Identity, Encryption, NetworkRuleSet = \
cmd.get_models('StorageAccountUpdateParameters', 'Sku', 'CustomDomain', 'AccessTier', 'Identity', 'Encryption',
'NetworkRuleSet')
Expand Down Expand Up @@ -356,6 +359,9 @@ def update_storage_account(cmd, instance, sku=None, tags=None, custom_domain=Non
if min_tls_version:
params.minimum_tls_version = min_tls_version

if allow_shared_key_access is not None:
params.allow_shared_key_access = allow_shared_key_access

return params


Expand Down
Loading