Share via


az sig image-version

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Manage shared gallery image version with VM.

Commands

Name Description Type Status
az sig image-version create

Create a new image version.

Core GA
az sig image-version delete

Delete a gallery image version.

Core GA
az sig image-version list

List gallery image versions in a gallery image definition.

Core GA
az sig image-version list-community

List VM Image Versions in a gallery community.

Core GA
az sig image-version list-community (image-gallery extension)

List VM Image Versions in a gallery community (preview).

Extension Experimental
az sig image-version list-shared

List VM Image Versions in a gallery shared directly to your subscription or tenant.

Core GA
az sig image-version show

Retrieves information about a gallery image version.

Core GA
az sig image-version show-community

Get a community gallery image version.

Core GA
az sig image-version show-community (image-gallery extension)

Get an image version in a gallery community (preview).

Extension Experimental
az sig image-version show-shared

Get an image version in a gallery shared directly to your subscription or tenant.

Core GA
az sig image-version undelete

Restore soft deleted Image Version.

Core Preview
az sig image-version update

Update a share image version.

Core GA
az sig image-version wait

Wait for image version related operation.

Core GA

az sig image-version create

Create a new image version.

This operation might take a long time depending on the replicate region number. Use "--no-wait" is advised.

az sig image-version create --gallery-image-definition
                            --gallery-image-version
                            --gallery-name
                            --resource-group
                            [--allow-replicated-location-deletion {false, true}]
                            [--data-snapshot-luns]
                            [--data-snapshots]
                            [--data-vhds-luns]
                            [--data-vhds-sa]
                            [--data-vhds-uris]
                            [--end-of-life-date]
                            [--exclude-from-latest {false, true}]
                            [--image-version]
                            [--location]
                            [--managed-image]
                            [--no-wait]
                            [--os-snapshot]
                            [--os-vhd-storage-account]
                            [--os-vhd-uri]
                            [--replica-count]
                            [--replication-mode {Full, Shallow}]
                            [--storage-account-type {Premium_LRS, Standard_LRS, Standard_ZRS}]
                            [--tags]
                            [--target-edge-zone-encryption]
                            [--target-edge-zones]
                            [--target-region-cvm-encryption]
                            [--target-region-encryption]
                            [--target-regions]
                            [--virtual-machine]

Examples

Add a new image version from a virtual machine

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM

Add a new image version from a managed image

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--managed-image /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/images/MyManagedImage

Add a new image version from another image version

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--image-version /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/galleries/MyGallery/images/MyImageDefinition/versions/1.0.0

Add a new image version from a managed disk

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyOSDisk

Add a new image version from a managed disk and add additional data disks

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyOSDisk \
--data-snapshots /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyDataDisk \
--data-snapshot-luns 0

Add a new image version from a snapshot of an OS disk.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyOsDiskSnapshot

Add a new image version from a snapshot of an OS disk and add additional snapshots as data disks

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyOsDiskSnapshot \
--data-snapshots /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyDiskSnapshot \
--data-snapshot-luns 0

Add a new image version from a VHD of an OS disk.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-vhd-storage-account /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/mystorageaccount \
--os-vhd-uri https://mystorageaccount.blob.core.windows.net/container/path_to_vhd_file

Add a new image version from a VHD of an OS disk and add additional VHDs as data disks

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-vhd-storage-account /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/mystorageaccount \
--os-vhd-uri https://mystorageaccount.blob.core.windows.net/container/path_to_vhd_file \
--data-vhds-sa /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/myotherstorageaccount \
--data-vhds-uris https://myotherstorageaccount.blob.core.windows.net/container/path_to_vhd_file \
--data-vhds-luns 0

You can combine snapshots, managed disks, and VHDs to create a new image version. Add a new image version using a VHD as the OS disk and a managed disk and a snapshot as data disks.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-vhd-storage-account /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/mystorageaccount \
--os-vhd-uri https://mystorageaccount.blob.core.windows.net/container/path_to_vhd_file \
--data-snapshots /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyDataDisk subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyDiskSnapshot \
--data-snapshot-luns 0 1

Add a new image version and copy it to additional regions. The home location for the source of the image version must be included in the list of target regions. For each additional region, you can specify a different replica count and storage account type. Otherwise, the region will inherit from the global. The default replica count is 1 and the default storage account type is Standard LRS. In this example, eastus2 will have one replica stored on Standard ZRS storage, ukwest will have 3 replicas stored on Standard ZRS storage, southindia will have one replica stored on Standard LRS storage, and brazilsouth will have 2 replicas stored on Standard LRS storage.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 --replica-count 1 \
--storage-account-type Standard_ZRS --managed-image image-name \
--target-regions eastus2 ukwest=3 southindia=standard_lrs \
brazilsouth=2=standard_lrs

Add a new image version with encryption using a disk encryption set. Encryption is applied to each disk that is a part of the image version.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--target-regions westus=2=standard eastus \
--target-region-encryption WestUSDiskEncryptionSet1,0,WestUSDiskEncryptionSet2 \
EastUSDiskEncryptionSet1,0,EastUSDiskEncryptionSet2

Add a new image version and copy it to extended locations.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 --replica-count 1 \
--storage-account-type Standard_ZRS --managed-image image-name \
--target-edge-zones westus=microsoftlosangeles1 eastus=microsoftlosangeles2=1 \
brazilsouth=2=standard_lrs

Add a new image version and copy it to extended locations with encryption using a disk encryption set.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--target-edge-zones westus=microsoftlosangeles1 \
--target-edge-zone-encryption microsoftlosangeles1,WestUSDiskEncryptionSet1,0,WestUSDiskEncryptionSet2

Add a new image version and don't wait on it. Later you can invoke "az sig image-version wait" command when ready to create a vm from the gallery image version

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--no-wait

Add a new image version but remove it from consideration as latest version in its image definition

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--exclude-from-latest true

Add a new image version and set its end-of-life date. The image version can still be used to create a virtual machine after its end-of-life date.

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--end-of-life-date 2024-08-02T00:00:00+00:00

Required Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-image-version -e

Gallery image version in semantic version pattern. The allowed characters are digit and period. Digits must be within the range of a 32-bit integer, e.g. <MajorVersion>.<MinorVersion>.<Patch>.

--gallery-name -r

Gallery name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--allow-replicated-location-deletion

Indicate whether or not removing this gallery image version from replicated regions is allowed.

Accepted values: false, true
--data-snapshot-luns

Logical unit numbers (space-delimited) of data disk snapshots.

--data-snapshots

Names or IDs (space-delimited) of data disk snapshots.

--data-vhds-luns

Logical unit numbers (space-delimited) of source VHD URIs of data disks.

--data-vhds-sa --data-vhds-storage-accounts

Names or IDs (space-delimited) of storage accounts of source VHD URIs of data disks.

--data-vhds-uris

Source VHD URIs (space-delimited) of data disks.

--end-of-life-date

The end of life date, e.g. '2020-12-31'.

--exclude-from-latest

The flag means that if it is set to true, people deploying VMs with version omitted will not use this version.

Accepted values: false, true
--image-version

Resource id of gallery image version source.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--managed-image

Image name(if in the same resource group) or resource id.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--os-snapshot

Name or ID of OS disk snapshot.

--os-vhd-storage-account

Name or ID of storage account of source VHD URI of OS disk.

--os-vhd-uri

Source VHD URI of OS disk.

--replica-count

The default number of replicas to be created per region. To set regional replication counts, use --target-regions.

--replication-mode

Optional parameter which specifies the mode to be used for replication. This property is not updatable.

Accepted values: Full, Shallow
--storage-account-type

The default storage account type to be used per region. To set regional storage account types, use --target-regions.

Accepted values: Premium_LRS, Standard_LRS, Standard_ZRS
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--target-edge-zone-encryption --zone-encryption

Space-separated list of customer managed keys for encrypting the OS and data disks in the gallery artifact for each region. Format for each edge zone: ,<os_des>,,<lun1_des>,,<lun2_des>.

--target-edge-zones

Space-separated list of regions, edge zones, replica counts and storage types. Use =[=][=] to optionally set the replica count and/or storage account type for each region. If a replica count is not specified, the default replica count will be used. If a storage account type is not specified, the default storage account type will be used. If "--target-edge-zones None" is specified, the target extended locations will be cleared.

--target-region-cvm-encryption

Space-separated list of customer managed key for Confidential VM encrypting the OS disk in the gallery artifact for each region. Format for each region: <os_cvm_encryption_type>,<os_cvm_des>. The valid values for os_cvm_encryption_type are EncryptedVMGuestStateOnlyWithPmk, EncryptedWithPmk, EncryptedWithCmk.

--target-region-encryption

Space-separated list of customer managed keys for encrypting the OS and data disks in the gallery artifact for each region. Format for each region: <os_des>,<lun1>,<lun1_des>,<lun2>,<lun2_des>. Use "null" as a placeholder.

--target-regions

Space-separated list of regions and their replica counts. Use <region>[=<replica count>][=<storage account type>] to optionally set the replica count and/or storage account type for each region. If a replica count is not specified, the default replica count will be used. If a storage account type is not specified, the default storage account type will be used.

--virtual-machine

Resource id of VM source.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version delete

Delete a gallery image version.

az sig image-version delete [--gallery-image-definition]
                            [--gallery-image-version]
                            [--gallery-name]
                            [--ids]
                            [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                            [--resource-group]
                            [--subscription]

Optional Parameters

--gallery-image-definition --gallery-image-name -i

The name of the gallery image definition in which the Image Version resides.

--gallery-image-version --gallery-image-version-name -e

The name of the gallery image version to be deleted.

--gallery-name -r

The name of the Shared Image Gallery in which the Image Definition resides.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version list

List gallery image versions in a gallery image definition.

az sig image-version list --gallery-image-definition
                          --gallery-name
                          --resource-group
                          [--max-items]
                          [--next-token]

Required Parameters

--gallery-image-definition --gallery-image-name -i

Gallery image definition.

--gallery-name -r

Gallery name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version list-community

List VM Image Versions in a gallery community.

az sig image-version list-community [--gallery-image-definition]
                                    [--ids]
                                    [--location]
                                    [--marker]
                                    [--public-gallery-name]
                                    [--show-next-marker]
                                    [--subscription]

Examples

List an image versions in a gallery community.

az sig image-version list-community --public-gallery-name publicGalleryName \
--gallery-image-definition MyImage --location myLocation

Optional Parameters

--gallery-image-definition -i

The name of the community gallery image definition from which the image versions are to be listed.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--marker

A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. If specified, this generator will begin returning results from the point where the previous generator stopped.

--public-gallery-name

The public name of community gallery.

--show-next-marker

Show nextMarker in result when specified.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version list-community (image-gallery extension)

Experimental

This command is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List VM Image Versions in a gallery community (preview).

List VM Image Versions in a gallery community (private preview feature, please contact community image gallery team by email sigpmdev@microsoft.com to register for preview if you're interested in using this feature).

az sig image-version list-community [--gallery-image-definition]
                                    [--ids]
                                    [--location]
                                    [--marker]
                                    [--public-gallery-name]
                                    [--show-next-marker]
                                    [--subscription]

Examples

List an image versions in a gallery community.

az sig image-version list-community --public-gallery-name publicGalleryName \
--gallery-image-definition MyImage --location myLocation

Optional Parameters

--gallery-image-definition -i

The name of the community gallery image definition from which the image versions are to be listed.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--marker

A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. If specified, this generator will begin returning results from the point where the previous generator stopped.

--public-gallery-name

The public name of community gallery.

--show-next-marker

Show nextMarker in result when specified.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version list-shared

List VM Image Versions in a gallery shared directly to your subscription or tenant.

az sig image-version list-shared [--gallery-image-definition]
                                 [--gallery-unique-name]
                                 [--ids]
                                 [--location]
                                 [--marker]
                                 [--shared-to {tenant}]
                                 [--show-next-marker]
                                 [--subscription]

Examples

List image versions in a gallery shared directly to your subscription in the given location and image definition.

az sig image-version list-shared --gallery-unique-name galleryUniqueName \
--gallery-image-definition MyImage --location myLocation

List image versions in a gallery shared directly to your tenant in the given location and image definition.

az sig image-version list-shared --gallery-unique-name galleryUniqueName \
--gallery-image-definition MyImage --location myLocation --shared-to tenant

Optional Parameters

--gallery-image-definition -i

The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.

--gallery-unique-name

The unique name of the Shared Gallery.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--marker

A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. If specified, this generator will begin returning results from the point where the previous generator stopped.

--shared-to

The query parameter to decide what shared galleries to fetch when doing listing operations. If not specified, list by subscription id.

Accepted values: tenant
--show-next-marker

Show nextMarker in result when specified.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version show

Retrieves information about a gallery image version.

az sig image-version show --gallery-image-definition
                          --gallery-image-version
                          --gallery-name
                          --resource-group
                          [--expand]

Required Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-image-version -e

Gallery image version in semantic version pattern. The allowed characters are digit and period. Digits must be within the range of a 32-bit integer, e.g. <MajorVersion>.<MinorVersion>.<Patch>.

--gallery-name -r

Gallery name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--expand

The expand expression to apply on the operation, e.g. 'ReplicationStatus'.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version show-community

Get a community gallery image version.

az sig image-version show-community [--gallery-image-definition]
                                    [--gallery-image-version]
                                    [--ids]
                                    [--location]
                                    [--public-gallery-name]
                                    [--subscription]

Optional Parameters

--gallery-image-definition --gallery-image-name -i

The name of the community gallery image definition from which the image versions are to be listed.

--gallery-image-version --gallery-image-version-name -e

Gallery image version in semantic version pattern. The allowed characters are digit and period. Digits must be within the range of a 32-bit integer, e.g. <MajorVersion>.<MinorVersion>.<Patch>.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--public-gallery-name

The public name of the community gallery.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version show-community (image-gallery extension)

Experimental

This command is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get an image version in a gallery community (preview).

Get an image version in a gallery community (private preview feature, please contact community image gallery team by email sigpmdev@microsoft.com to register for preview if you're interested in using this feature).

az sig image-version show-community [--gallery-image-definition]
                                    [--gallery-image-version]
                                    [--ids]
                                    [--location]
                                    [--public-gallery-name]
                                    [--subscription]

Examples

Get an image version in a gallery community in the given location.

az sig image-version show-community --public-gallery-name publicGalleryName \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 --location myLocation

Optional Parameters

--gallery-image-definition -i

The name of the community gallery image definition from which the image versions are to be listed.

--gallery-image-version -e

The name of the gallery image version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ...

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--public-gallery-name

The public name of community gallery.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version show-shared

Get an image version in a gallery shared directly to your subscription or tenant.

az sig image-version show-shared [--gallery-image-definition]
                                 [--gallery-image-version]
                                 [--gallery-unique-name]
                                 [--ids]
                                 [--location]
                                 [--subscription]

Examples

Get an image version in a gallery shared directly to your subscription or tenant in the given location.

az sig image-version show-shared --gallery-unique-name galleryUniqueName --gallery-image-definition MyImage --gallery-image-version 1.0.0 --location myLocation

Optional Parameters

--gallery-image-definition --gallery-image-name -i

The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.

--gallery-image-version --gallery-image-version-name -e

The name of the gallery image version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ...

--gallery-unique-name

The unique name of the Shared Gallery.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version undelete

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Restore soft deleted Image Version.

Operation will only be successful if used within a Gallery with soft-deletion on.

az sig image-version undelete --gallery-image-definition
                              --gallery-image-version
                              --gallery-name
                              --resource-group
                              [--allow-replicated-location-deletion {false, true}]
                              [--location]
                              [--no-wait]
                              [--tags]

Examples

Restore a soft deleted Image Version

az sig image-version undelete --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.1.1

Required Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-image-version -e

Gallery image version in semantic version pattern. The allowed characters are digit and period. Digits must be within the range of a 32-bit integer, e.g. <MajorVersion>.<MinorVersion>.<Patch>.

--gallery-name -r

Gallery name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--allow-replicated-location-deletion

Indicate whether or not removing this gallery image version from replicated regions is allowed.

Accepted values: false, true
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version update

Update a share image version.

az sig image-version update --gallery-image-definition
                            --gallery-image-version
                            --gallery-name
                            --resource-group
                            [--add]
                            [--allow-replicated-location-deletion {false, true}]
                            [--force-string]
                            [--no-wait]
                            [--remove]
                            [--replica-count]
                            [--set]
                            [--target-edge-zones]
                            [--target-regions]

Examples

Change the replication regions and replica count

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--target-regions westcentralus=2 eastus2

Change the replication extended locations

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--target-edge-zones westus=microsoftlosangeles1 eastus=microsoftlosangeles2=1

Clear the replication extended locations

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--target-edge-zones None

Replicate to an additional region. Optional, you can set the replica count for the region and exclude this image when using the latest version of the image definition.

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--add publishingProfile.targetRegions name=westcentralus \
regionalReplicaCount=3 excludeFromLatest=true

Change whether an image should be included in consideration for latest version in the image definition. Setting this value to true excludes the image from consideration and setting this value to false includes the image for consideration.

az sig image-version update -g MyResourceGroup --gallery-name MyGallery \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 \
--set publishingProfile.excludeFromLatest=true

Change the end of life date for an image version. The image can still be used to create virtual machines after the end of life date.

az sig image-version update -g MyResourceGroup --gallery-name MyGallery \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 \
--set publishingProfile.endOfLifeDate=2024-08-02T00:00:00+00:00

Allow to remove the gallery image version from replicated regions.

az sig image-version update -g MyResourceGroup --gallery-name MyGallery \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 \
--set safetyProfile.allowDeletionOfReplicatedLocations=true

Required Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-image-version -e

Gallery image version in semantic version pattern. The allowed characters are digit and period. Digits must be within the range of a 32-bit integer, e.g. <MajorVersion>.<MinorVersion>.<Patch>.

--gallery-name -r

Gallery name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Default value: []
--allow-replicated-location-deletion

Indicate whether or not removing this gallery image version from replicated regions is allowed.

Accepted values: false, true
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Default value: False
--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Default value: []
--replica-count

The default number of replicas to be created per region. To set regional replication counts, use --target-regions.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Default value: []
--target-edge-zones

Space-separated list of regions, edge zones, replica counts and storage types. Use =[=][=] to optionally set the replica count and/or storage account type for each region. If a replica count is not specified, the default replica count will be used. If a storage account type is not specified, the default storage account type will be used. If "--target-edge-zones None" is specified, the target extended locations will be cleared.

--target-regions

Space-separated list of regions and their replica counts. Use <region>[=<replica count>][=<storage account type>] to optionally set the replica count and/or storage account type for each region. If a replica count is not specified, the default replica count will be used. If a storage account type is not specified, the default storage account type will be used.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sig image-version wait

Wait for image version related operation.

az sig image-version wait --gallery-image-definition
                          --gallery-image-version
                          --gallery-name
                          --resource-group
                          [--created]
                          [--custom]
                          [--deleted]
                          [--exists]
                          [--expand]
                          [--interval]
                          [--timeout]
                          [--updated]

Examples

wait for an image version gets updated

az sig image-version wait --updated --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0

wait for image version related operation. (autogenerated)

az sig image-version wait --created --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0

Required Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-image-version -e

Gallery image version in semantic version pattern. The allowed characters are digit and period. Digits must be within the range of a 32-bit integer, e.g. <MajorVersion>.<MinorVersion>.<Patch>.

--gallery-name -r

Gallery name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--expand

The expand expression to apply on the operation. 'ReplicationStatus' Default value is None.

--interval

Polling interval in seconds.

Default value: 30
--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.