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 @@ -419,7 +419,7 @@ def _build_args_gallery_disk_image_source_create(cls, _schema):
options=["id"],
help="The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource.",
)
gallery_disk_image_source_create.storage_account_id = AAZStrArg(
gallery_disk_image_source_create.storage_account_id = AAZResourceIdArg(
options=["storage-account-id"],
help="The Storage Account Id that contains the vhd blob being used as a source for this artifact version.",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def _build_args_gallery_disk_image_source_update(cls, _schema):
help="The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource.",
nullable=True,
)
gallery_disk_image_source_update.storage_account_id = AAZStrArg(
gallery_disk_image_source_update.storage_account_id = AAZResourceIdArg(
options=["storage-account-id"],
help="The Storage Account Id that contains the vhd blob being used as a source for this artifact version.",
nullable=True,
Expand Down
12 changes: 10 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 @@ -4883,7 +4883,12 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n
os_vhd_storage_account = resource_id(
subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name,
namespace='Microsoft.Storage', type='storageAccounts', name=os_vhd_storage_account)
os_disk_image = {"source": {"id": os_vhd_storage_account, "uri": os_vhd_uri}}
os_disk_image = {
"source": {
"storage_account_id": os_vhd_storage_account,
"uri": os_vhd_uri
}
}

# Data disks
if data_vhds_uris and data_vhds_storage_accounts is None or \
Expand Down Expand Up @@ -4912,7 +4917,10 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n
if data_disk_images is None:
data_disk_images = []
for uri, lun, account in zip(data_vhds_uris, data_vhds_luns, data_vhds_storage_accounts):
data_disk_images.append({"source": {"id": account, "uri": uri}, "lun": lun})
data_disk_images.append({
"source": {"storage_account_id": account, "uri": uri},
"lun": lun
})

storage_profile = {"source": source, "os_disk_image": os_disk_image, "data_disk_images": data_disk_images}
args = {
Expand Down
Loading