Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6bad64f
bump version to azure-mgmt-storage==23.1.0
calvinhzy Sep 22, 2025
5e48efa
Rerun tests from instance 4. See test_results_None_latest_4.parallel.…
azclibot Sep 22, 2025
7b61303
Rerun tests from instance 3. See test_results_None_latest_3.parallel.…
azclibot Sep 22, 2025
9165397
Rerun tests from instance 7. See test_results_None_latest_7.parallel.…
azclibot Sep 22, 2025
5dbdedf
Rerun tests from instance 1. See test_results_None_latest_1.serial.xm…
azclibot Sep 22, 2025
73a8304
Rerun tests from instance 2. See test_results_None_latest_2.parallel.…
azclibot Sep 22, 2025
585a840
Rerun tests from instance 5. See test_results_None_latest_5.parallel.…
azclibot Sep 22, 2025
4d3044d
Rerun tests from instance 8. See test_results_None_latest_8.parallel.…
azclibot Sep 22, 2025
ee38c61
fix some recordings
calvinhzy Sep 23, 2025
090b823
fix storage recordings, euap locations are not available for bami ten…
calvinhzy Sep 24, 2025
fa12862
fix some vm tests
calvinhzy Sep 24, 2025
bb1f124
Merge remote-tracking branch 'upstream/dev' into bump-mgmt-storage-20…
calvinhzy Sep 25, 2025
f90a665
as storage module tests passed, directly replacing api-version for ot…
calvinhzy Sep 25, 2025
4110776
fix some more recordings
calvinhzy Sep 25, 2025
8543dca
rerun tests
calvinhzy Sep 25, 2025
6369f8a
add `--enable-smb-oauth` to `az storage account create/update`
calvinhzy Sep 26, 2025
4da22b3
Merge remote-tracking branch 'upstream/dev' into storage-account-isSm…
calvinhzy Sep 26, 2025
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
7 changes: 7 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 @@ -432,6 +432,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
help='Allow you to specify the type of endpoint. Set this to AzureDNSZone to create a large number '
'of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the '
'endpoint URL will have an alphanumeric DNS Zone identifier.')
c.argument('enable_smb_oauth', arg_type=get_three_state_flag(),
arg_group='Azure Files Identity Based Authentication',
help='Specifies if managed identities can access SMB shares using OAuth. '
'The default interpretation is false for this property.')

with self.argument_context('storage account private-endpoint-connection',
resource_type=ResourceType.MGMT_STORAGE) as c:
Expand Down Expand Up @@ -523,6 +527,9 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.argument('upgrade_to_storagev2', arg_type=get_three_state_flag(),
help='Upgrade Storage Account Kind to StorageV2.')
c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')
c.argument('enable_smb_oauth', arg_type=get_three_state_flag(),
arg_group='Azure Files Identity Based Authentication',
help='Specifies if managed identities can access SMB shares using OAuth. ')

for scope in ['storage account create', 'storage account update']:
with self.argument_context(scope, arg_group='Customer managed key',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def create_storage_account(cmd, resource_group_name, account_name, sku=None, loc
allow_cross_tenant_replication=None, default_share_permission=None,
enable_nfs_v3=None, subnet=None, vnet_name=None, action='Allow', enable_alw=None,
immutability_period_since_creation_in_days=None, immutability_policy_state=None,
allow_protected_append_writes=None, public_network_access=None, dns_endpoint_type=None):
allow_protected_append_writes=None, public_network_access=None, dns_endpoint_type=None,
enable_smb_oauth=None):
StorageAccountCreateParameters, Kind, Sku, CustomDomain, AccessTier, Identity, Encryption, NetworkRuleSet = \
cmd.get_models('StorageAccountCreateParameters', 'Kind', 'Sku', 'CustomDomain', 'AccessTier', 'Identity',
'Encryption', 'NetworkRuleSet')
Expand Down Expand Up @@ -198,6 +199,14 @@ def create_storage_account(cmd, resource_group_name, account_name, sku=None, loc
directory_service_options='None')
params.azure_files_identity_based_authentication.default_share_permission = default_share_permission

if enable_smb_oauth is not None:
if params.azure_files_identity_based_authentication is None:
params.azure_files_identity_based_authentication = AzureFilesIdentityBasedAuthentication(
directory_service_options='None')
params.azure_files_identity_based_authentication.smb_o_auth_settings = {
"is_smb_o_auth_enabled": enable_smb_oauth
}

if enable_large_file_share:
LargeFileSharesState = cmd.get_models('LargeFileSharesState')
params.large_file_shares_state = LargeFileSharesState("Enabled")
Expand Down Expand Up @@ -398,7 +407,7 @@ def update_storage_account(cmd, instance, sku=None, tags=None, custom_domain=Non
allow_cross_tenant_replication=None, default_share_permission=None,
immutability_period_since_creation_in_days=None, immutability_policy_state=None,
allow_protected_append_writes=None, public_network_access=None, upgrade_to_storagev2=None,
yes=None):
yes=None, enable_smb_oauth=None):
StorageAccountUpdateParameters, Sku, CustomDomain, AccessTier, Identity, Encryption, NetworkRuleSet, Kind = \
cmd.get_models('StorageAccountUpdateParameters', 'Sku', 'CustomDomain', 'AccessTier', 'Identity', 'Encryption',
'NetworkRuleSet', 'Kind')
Expand Down Expand Up @@ -610,6 +619,15 @@ def update_storage_account(cmd, instance, sku=None, tags=None, custom_domain=Non
else instance.azure_files_identity_based_authentication
params.azure_files_identity_based_authentication.default_share_permission = default_share_permission

if enable_smb_oauth is not None:
if params.azure_files_identity_based_authentication is None:
params.azure_files_identity_based_authentication = AzureFilesIdentityBasedAuthentication(
directory_service_options='None') if instance.azure_files_identity_based_authentication is None \
else instance.azure_files_identity_based_authentication
params.azure_files_identity_based_authentication.smb_o_auth_settings = {
"is_smb_o_auth_enabled": enable_smb_oauth
}

if assign_identity:
params.identity = Identity(type='SystemAssigned')
if enable_large_file_share:
Expand Down
Loading