az sig image-definition

Manage shared gallery image with VM.

Commands

az sig image-definition create

Create a gallery image definition.

az sig image-definition delete

Delete a gallery image.

az sig image-definition list

List gallery image definitions in a gallery.

az sig image-definition list-community

List VM Image definitions in a gallery community.

az sig image-definition list-shared

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

az sig image-definition show

Retrieves information about a gallery image definition.

az sig image-definition show-community

Get a community gallery image.

az sig image-definition show-shared

Get a shared gallery image.

az sig image-definition update

Update a VM Image definition.

az sig image-definition create

Create a gallery image definition.

az sig image-definition create --gallery-image-definition
                               --gallery-name
                               --offer
                               --os-type {Linux, Windows}
                               --publisher
                               --resource-group
                               --sku
                               [--architecture {Arm64, x64}]
                               [--description]
                               [--disallowed-disk-types]
                               [--end-of-life-date]
                               [--eula]
                               [--features]
                               [--hyper-v-generation {V1, V2}]
                               [--location]
                               [--maximum-cpu-core]
                               [--maximum-memory]
                               [--minimum-cpu-core]
                               [--minimum-memory]
                               [--os-state {Generalized, Specialized}]
                               [--plan-name]
                               [--plan-product]
                               [--plan-publisher]
                               [--privacy-statement-uri]
                               [--release-note-uri]
                               [--tags]

Examples

Create an image definition for specialized linux images

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized

Create an image definition for generalized linux images

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Generalized

Create an image definition for specialized windows images

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type windows --os-state Specialized

Create an image definition for generalized windows images

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type windows --os-state Generalized

Create an image definition with plan information

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized --plan-name PlanName \
--plan-product PlanProduct --plan-publisher PlanPublisher

Create an image definition for images that support hibernate feature

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--features IsHibernateSupported=true

Create an image definition for images that support accelerated networking

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--features IsAcceleratedNetworkSupported=true

Create an image definition for images that can only be used to create Trusted VMs. Only Trusted VMs can be created from this image.

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--features SecurityType=TrustedLaunch

Create an image definition for images that can be used to create Confidential VMs.

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--features SecurityType=ConfidentialVmSupported

Create an image definition for images that can only be used to create Confidential VMs. Only Confidential VMs can be created from this image.

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--features SecurityType=ConfidentialVM

Create an image definition and indicate end of life date

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--end-of-life-date YYYY-MM-DDTHH:MM:SS+00:00

Create an image definition and recommend minimum and maximum CPU and memory (GB)

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--minimum-cpu-core myMinCPU --maximum-cpu-core myMaxCPU \
--minimum-memory myMinMemory --maximum-memory myMaxMemory

Create an image definition and indicate which OS disk types are not recommended for the image

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--disallowed-disk-types Standard_LRS

Create an image definition and provide the EULA, privacy statement URI, and release notes URI

az sig image-definition create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--publisher GreatPublisher --offer GreatOffer --sku GreatSku \
--os-type linux --os-state Specialized \
--eula path_to_eula --privacy-statement-uri path_to_statement \
--release-note-uri path_to_release_notes

Required Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-name -r

Gallery name.

--offer -f

Image offer.

--os-type

The type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

accepted values: Linux, Windows
--publisher -p

Image publisher.

--resource-group -g

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

--sku -s

Image sku.

Optional Parameters

--architecture

CPU architecture.

accepted values: Arm64, x64
--description

The description of the gallery image definition.

--disallowed-disk-types

Disk types which would not work with the image, e.g., Standard_LRS.

--end-of-life-date

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

--eula

The Eula agreement for the gallery image.

--features

A list of gallery image features. E.g. "IsSecureBootSupported=true IsMeasuredBootSupported=false".

--hyper-v-generation

The hypervisor generation of the Virtual Machine. Applicable to OS disks only.

accepted values: V1, V2
default value: V1
--location -l

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

--maximum-cpu-core

Maximum cpu cores.

--maximum-memory

Maximum memory in MB.

--minimum-cpu-core

Minimum cpu cores.

--minimum-memory

Minimum memory in MB.

--os-state

This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'.

accepted values: Generalized, Specialized
default value: Generalized
--plan-name

Plan name.

--plan-product

Plan product.

--plan-publisher

Plan publisher.

--privacy-statement-uri

The privacy statement uri.

--release-note-uri

The release note uri.

--tags

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

az sig image-definition delete

Delete a gallery image.

az sig image-definition delete [--gallery-image-definition]
                               [--gallery-name]
                               [--ids]
                               [--resource-group]
                               [--subscription]

Optional Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-name -r

Gallery name.

--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.

--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.

az sig image-definition list

List gallery image definitions in a gallery.

az sig image-definition list --gallery-name
                             --resource-group

Required Parameters

--gallery-name -r

Gallery name.

--resource-group -g

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

az sig image-definition list-community

List VM Image definitions in a gallery community.

List VM Image definitions in a gallery community.

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

Examples

List an image definition in a gallery community.

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

Optional Parameters

--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.

az sig image-definition list-shared

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

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

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

Examples

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

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

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

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

Optional Parameters

--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.

az sig image-definition show

Retrieves information about a gallery image definition.

az sig image-definition show [--gallery-image-definition]
                             [--gallery-name]
                             [--ids]
                             [--resource-group]
                             [--subscription]

Optional Parameters

--gallery-image-definition -i

Gallery image definition.

--gallery-name -r

Gallery name.

--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.

--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.

az sig image-definition show-community

Get a community gallery image.

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

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>.

--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.

az sig image-definition show-shared

Get a shared gallery image.

Get a shared gallery image that has been shared directly to your subscription or tenant.

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

Examples

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

az sig image-definition show-shared --gallery-unique-name galleryUniqueName \
--gallery-image-definition myGalleryImageName --location myLocation

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>.

--subscription

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

az sig image-definition update

Update a VM Image definition.

az sig image-definition update --gallery-image-definition
                               --gallery-name
                               --resource-group
                               [--add]
                               [--force-string]
                               [--remove]
                               [--set]

Examples

Change the shared image definition's recommended configuration

az sig image-definition update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--resource-group MyResourceGroup --set recommended.vCpUs.min=myNewvCpUsMin \
recommended.vCpUs.max=myNewvCpUsMax recommended.memory.min=myNewMemoryMin \
recommended.memory.max=myNewMemoryMax description="newDescription"

Remove a shared image definition's configuration property

az sig image-definition update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--resource-group MyResourceGroup --remove recommended.vCpUs.min

Required Parameters

--gallery-image-definition -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

--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: []
--force-string

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

default value: False
--remove

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

default value: []
--set

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

default value: []