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
1 change: 1 addition & 0 deletions src/azure-cli/azure/cli/command_modules/vm/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def load_arguments(self, _):
c.argument('security_type', arg_type=get_enum_type(self.get_models('DiskSecurityTypes', operation_group='disks')), help='The security type of the VM. Applicable for OS disks only.', min_api='2020-12-01')
c.argument('support_hibernation', arg_type=get_three_state_flag(), help='Indicate the OS on a disk supports hibernation.', min_api='2020-12-01')
c.argument('architecture', arg_type=get_enum_type(self.get_models('Architecture', operation_group='disks')), min_api='2021-12-01', help='CPU architecture.')
c.argument('data_access_auth_mode', arg_type=get_enum_type(['AzureActiveDirectory', 'None']), min_api='2021-12-01', help='Specify the auth mode when exporting or uploading to a disk or snapshot.')
# endregion

# region Snapshots
Expand Down
9 changes: 7 additions & 2 deletions src/azure-cli/azure/cli/command_modules/vm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ def create_managed_disk(cmd, resource_group_name, disk_name, location=None, # p
gallery_image_reference=None, gallery_image_reference_lun=None,
network_access_policy=None, disk_access=None, logical_sector_size=None,
tier=None, enable_bursting=None, edge_zone=None, security_type=None, support_hibernation=None,
public_network_access=None, accelerated_network=None, architecture=None):
public_network_access=None, accelerated_network=None, architecture=None,
data_access_auth_mode=None):
from msrestazure.tools import resource_id, is_valid_resource_id
from azure.cli.core.commands.client_factory import get_subscription_id

Expand Down Expand Up @@ -416,6 +417,8 @@ def create_managed_disk(cmd, resource_group_name, disk_name, location=None, # p
else:
disk.supported_capabilities.accelerated_network = accelerated_network
disk.supported_capabilities.architecture = architecture
if data_access_auth_mode is not None:
disk.data_access_auth_mode = data_access_auth_mode

client = _compute_client_factory(cmd.cli_ctx)
return sdk_no_wait(no_wait, client.disks.begin_create_or_update, resource_group_name, disk_name, disk)
Expand All @@ -437,7 +440,7 @@ def update_managed_disk(cmd, resource_group_name, instance, size_gb=None, sku=No
disk_mbps_read_write=None, encryption_type=None, disk_encryption_set=None,
network_access_policy=None, disk_access=None, max_shares=None, disk_iops_read_only=None,
disk_mbps_read_only=None, enable_bursting=None, public_network_access=None,
accelerated_network=None, architecture=None):
accelerated_network=None, architecture=None, data_access_auth_mode=None):
from msrestazure.tools import resource_id, is_valid_resource_id
from azure.cli.core.commands.client_factory import get_subscription_id

Expand Down Expand Up @@ -486,6 +489,8 @@ def update_managed_disk(cmd, resource_group_name, instance, size_gb=None, sku=No
else:
instance.supported_capabilities.accelerated_network = accelerated_network
instance.supported_capabilities.architecture = architecture
if data_access_auth_mode is not None:
instance.data_access_auth_mode = data_access_auth_mode

return instance
# endregion
Expand Down
Loading