Microsoft.Compute galleries/images/versions template reference

Template format

To create a Microsoft.Compute/galleries/images/versions resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.Compute/galleries/images/versions",
  "apiVersion": "2019-12-01",
  "location": "string",
  "tags": {},
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "string",
          "regionalReplicaCount": "integer",
          "storageAccountType": "string",
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "string"
            },
            "dataDiskImages": [
              {
                "diskEncryptionSetId": "string",
                "lun": "integer"
              }
            ]
          }
        }
      ],
      "replicaCount": "integer",
      "excludeFromLatest": "boolean",
      "endOfLifeDate": "string",
      "storageAccountType": "string"
    },
    "storageProfile": {
      "source": {
        "id": "string"
      },
      "osDiskImage": {
        "hostCaching": "string",
        "source": {
          "id": "string"
        }
      },
      "dataDiskImages": [
        {
          "hostCaching": "string",
          "source": {
            "id": "string"
          },
          "lun": "integer"
        }
      ]
    }
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Compute/galleries/images/versions object

Name Type Required Value
name string Yes 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: ..
type enum Yes versions
-or-
Microsoft.Compute/galleries/images/versions

See Set name and type for child resources.
apiVersion enum Yes 2019-12-01
location string Yes Resource location
tags object No Resource tags
properties object Yes GalleryImageVersionProperties object

GalleryImageVersionProperties object

Name Type Required Value
publishingProfile object No GalleryImageVersionPublishingProfile object
storageProfile object Yes GalleryImageVersionStorageProfile object

GalleryImageVersionPublishingProfile object

Name Type Required Value
targetRegions array No The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegion object
replicaCount integer No The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable.
excludeFromLatest boolean No If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
endOfLifeDate string No The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable.
storageAccountType enum No Specifies the storage account type to be used to store the image. This property is not updatable. - Standard_LRS, Standard_ZRS, Premium_LRS

GalleryImageVersionStorageProfile object

Name Type Required Value
source object No GalleryArtifactVersionSource object
osDiskImage object No GalleryOSDiskImage object
dataDiskImages array No A list of data disk images. - GalleryDataDiskImage object

TargetRegion object

Name Type Required Value
name string Yes The name of the region.
regionalReplicaCount integer No The number of replicas of the Image Version to be created per region. This property is updatable.
storageAccountType enum No Specifies the storage account type to be used to store the image. This property is not updatable. - Standard_LRS, Standard_ZRS, Premium_LRS
encryption object No EncryptionImages object

GalleryArtifactVersionSource object

Name Type Required Value
id string No The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image.

GalleryOSDiskImage object

Name Type Required Value
hostCaching enum No The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. - None, ReadOnly, ReadWrite
source object No GalleryArtifactVersionSource object

GalleryDataDiskImage object

Name Type Required Value
hostCaching enum No The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. - None, ReadOnly, ReadWrite
source object No GalleryArtifactVersionSource object
lun integer Yes This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine.

EncryptionImages object

Name Type Required Value
osDiskImage object No OSDiskImageEncryption object
dataDiskImages array No A list of encryption specifications for data disk images. - DataDiskImageEncryption object

OSDiskImageEncryption object

Name Type Required Value
diskEncryptionSetId string No A relative URI containing the resource ID of the disk encryption set.

DataDiskImageEncryption object

Name Type Required Value
diskEncryptionSetId string No A relative URI containing the resource ID of the disk encryption set.
lun integer Yes This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine.

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Create an Image Version in a Shared Image Gallery

Deploy to Azure
This template allows you to create a simple Image Version in a Shared Image Gallery. Please ensure that you have run the Shared Image Gallery 101 Template and the Image Definition 101 Template before you deploy this.