Microsoft.Compute galleries/images/versions

The galleries/images/versions resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

To create a Microsoft.Compute/galleries/images/versions resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.Compute/galleries/images/versions@2020-09-30' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    publishingProfile: {
      endOfLifeDate: 'string'
      excludeFromLatest: bool
      replicaCount: int
      storageAccountType: 'string'
      targetRegions: [
        {
          encryption: {
            dataDiskImages: [
              {
                diskEncryptionSetId: 'string'
                lun: int
              }
            ]
            osDiskImage: {
              diskEncryptionSetId: 'string'
            }
          }
          name: 'string'
          regionalReplicaCount: int
          storageAccountType: 'string'
        }
      ]
    }
    storageProfile: {
      dataDiskImages: [
        {
          lun: int
          source: {
            id: 'string'
            uri: 'string'
          }
        }
      ]
      osDiskImage: {
        source: {
          id: 'string'
          uri: 'string'
        }
      }
      source: {
        id: 'string'
        uri: 'string'
      }
    }
  }
}

Property values

galleries/images/versions

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.Compute/galleries/images/versions'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2020-09-30'
name The resource name

See how to set names and types for child resources in Bicep or JSON ARM templates.
string (required)
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties Describes the properties of a gallery image version. GalleryImageVersionProperties

GalleryImageVersionProperties

Name Description Value
publishingProfile The publishing profile of a gallery image Version. GalleryImageVersionPublishingProfile
storageProfile This is the storage profile of a Gallery Image Version. GalleryImageVersionStorageProfile (required)

GalleryImageVersionPublishingProfile

Name Description Value
endOfLifeDate The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. string
excludeFromLatest If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. bool
replicaCount 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. int
storageAccountType Specifies the storage account type to be used to store the image. This property is not updatable. 'Premium_LRS'
'Standard_LRS'
'Standard_ZRS'
targetRegions The target regions where the Image Version is going to be replicated to. This property is updatable. TargetRegion[]

TargetRegion

Name Description Value
encryption Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. EncryptionImages
name The name of the region. string (required)
regionalReplicaCount The number of replicas of the Image Version to be created per region. This property is updatable. int
storageAccountType Specifies the storage account type to be used to store the image. This property is not updatable. 'Premium_LRS'
'Standard_LRS'
'Standard_ZRS'

EncryptionImages

Name Description Value
dataDiskImages A list of encryption specifications for data disk images. DataDiskImageEncryption[]
osDiskImage Contains encryption settings for an OS disk image. OSDiskImageEncryption

DataDiskImageEncryption

Name Description Value
diskEncryptionSetId A relative URI containing the resource ID of the disk encryption set. string
lun 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. int (required)

OSDiskImageEncryption

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

GalleryImageVersionStorageProfile

Name Description Value
dataDiskImages A list of data disk images. GalleryDataDiskImage[]
osDiskImage This is the OS disk image. GalleryOSDiskImage
source The gallery artifact version source. GalleryArtifactVersionSource

GalleryDataDiskImage

Name Description Value
lun 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. int (required)
source The gallery artifact version source. GalleryArtifactVersionSource

GalleryArtifactVersionSource

Name Description Value
id The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. string
uri The uri of the gallery artifact version source. Currently used to specify vhd/blob source. string

GalleryOSDiskImage

Name Description Value
source The gallery artifact version source. GalleryArtifactVersionSource

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.