Skip to content

Commit ed5fb44

Browse files
authored
[Compute] BREAKING CHANGE: az sig image-version create: Move to new properties (#31186)
1 parent be65c87 commit ed5fb44

File tree

6 files changed

+892
-853
lines changed

6 files changed

+892
-853
lines changed

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sig/image_version/_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def _build_args_gallery_disk_image_source_create(cls, _schema):
419419
options=["id"],
420420
help="The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource.",
421421
)
422-
gallery_disk_image_source_create.storage_account_id = AAZStrArg(
422+
gallery_disk_image_source_create.storage_account_id = AAZResourceIdArg(
423423
options=["storage-account-id"],
424424
help="The Storage Account Id that contains the vhd blob being used as a source for this artifact version.",
425425
)

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sig/image_version/_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def _build_args_gallery_disk_image_source_update(cls, _schema):
496496
help="The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource.",
497497
nullable=True,
498498
)
499-
gallery_disk_image_source_update.storage_account_id = AAZStrArg(
499+
gallery_disk_image_source_update.storage_account_id = AAZResourceIdArg(
500500
options=["storage-account-id"],
501501
help="The Storage Account Id that contains the vhd blob being used as a source for this artifact version.",
502502
nullable=True,

src/azure-cli/azure/cli/command_modules/vm/custom.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4883,7 +4883,12 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n
48834883
os_vhd_storage_account = resource_id(
48844884
subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name,
48854885
namespace='Microsoft.Storage', type='storageAccounts', name=os_vhd_storage_account)
4886-
os_disk_image = {"source": {"id": os_vhd_storage_account, "uri": os_vhd_uri}}
4886+
os_disk_image = {
4887+
"source": {
4888+
"storage_account_id": os_vhd_storage_account,
4889+
"uri": os_vhd_uri
4890+
}
4891+
}
48874892

48884893
# Data disks
48894894
if data_vhds_uris and data_vhds_storage_accounts is None or \
@@ -4912,7 +4917,10 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n
49124917
if data_disk_images is None:
49134918
data_disk_images = []
49144919
for uri, lun, account in zip(data_vhds_uris, data_vhds_luns, data_vhds_storage_accounts):
4915-
data_disk_images.append({"source": {"id": account, "uri": uri}, "lun": lun})
4920+
data_disk_images.append({
4921+
"source": {"storage_account_id": account, "uri": uri},
4922+
"lun": lun
4923+
})
49164924

49174925
storage_profile = {"source": source, "os_disk_image": os_disk_image, "data_disk_images": data_disk_images}
49184926
args = {

0 commit comments

Comments
 (0)