Gallery Image Versions - Create Or Update

Create or update a gallery Image Version.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}?api-version=2019-12-01

URI Parameters

Name In Required Type Description
galleryImageName
path True
  • string

The name of the gallery Image Definition in which the Image Version is to be created.

galleryImageVersionName
path True
  • string

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

galleryName
path True
  • string

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

resourceGroupName
path True
  • string

The name of the resource group.

subscriptionId
path True
  • string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True
  • string

Client Api Version.

Request Body

Name Required Type Description
location True
  • string

Resource location

properties.publishingProfile

The publishing profile of a gallery Image Version.

properties.storageProfile True

This is the storage profile of a Gallery Image Version.

tags
  • object

Resource tags

Responses

Name Type Description
200 OK

OK

201 Created

Created

202 Accepted

Accepted

Other Status Codes

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create or update a simple Gallery Image Version (Managed Image as source).
Create or update a simple Gallery Image Version using snapshots as a source.

Sample Request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName/versions/1.0.0?api-version=2019-12-01
{
  "location": "West US",
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "lun": 0,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"
              },
              {
                "lun": 1,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ]
    },
    "storageProfile": {
      "source": {
        "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"
      }
    }
  }
}

Sample Response

{
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "storageAccountType": "Standard_LRS",
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "lun": 0,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"
              },
              {
                "lun": 1,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ],
      "replicaCount": 1,
      "publishedDate": "2018-01-01T00:00:00Z",
      "storageAccountType": "Standard_LRS"
    },
    "storageProfile": {
      "source": {
        "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"
      },
      "osDiskImage": {
        "sizeInGB": 10,
        "hostCaching": "ReadOnly"
      },
      "dataDiskImages": [
        {
          "lun": 1,
          "sizeInGB": 10,
          "hostCaching": "None"
        }
      ]
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "1.0.0"
}
{
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "storageAccountType": "Standard_LRS",
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "lun": 0,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"
              },
              {
                "lun": 1,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ],
      "replicaCount": 1,
      "publishedDate": "2018-01-01T00:00:00Z",
      "storageAccountType": "Standard_LRS"
    },
    "storageProfile": {
      "source": {
        "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"
      },
      "osDiskImage": {
        "sizeInGB": 10,
        "hostCaching": "ReadOnly"
      },
      "dataDiskImages": [
        {
          "lun": 1,
          "sizeInGB": 10,
          "hostCaching": "None"
        }
      ]
    },
    "provisioningState": "Creating"
  },
  "location": "West US",
  "name": "1.0.0"
}
{
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "storageAccountType": "Standard_LRS",
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "lun": 0,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"
              },
              {
                "lun": 1,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ],
      "replicaCount": 1,
      "publishedDate": "2018-01-01T00:00:00Z",
      "storageAccountType": "Standard_LRS"
    },
    "storageProfile": {
      "source": {
        "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"
      },
      "osDiskImage": {
        "sizeInGB": 10,
        "hostCaching": "ReadOnly"
      },
      "dataDiskImages": [
        {
          "lun": 1,
          "sizeInGB": 10,
          "hostCaching": "None"
        }
      ]
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "1.0.0"
}

Sample Request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName/versions/1.0.0?api-version=2019-12-01
{
  "location": "West US",
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet",
                "lun": 1
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ]
    },
    "storageProfile": {
      "osDiskImage": {
        "source": {
          "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{snapshotName}"
        },
        "hostCaching": "ReadOnly"
      },
      "dataDiskImages": [
        {
          "source": {
            "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{diskSnapshotName}"
          },
          "lun": 1,
          "hostCaching": "None"
        }
      ]
    }
  }
}

Sample Response

{
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "storageAccountType": "Standard_LRS",
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "lun": 1,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ],
      "replicaCount": 1,
      "publishedDate": "2018-01-01T00:00:00Z",
      "storageAccountType": "Standard_LRS"
    },
    "storageProfile": {
      "osDiskImage": {
        "source": {
          "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"
        },
        "sizeInGB": 10,
        "hostCaching": "ReadOnly"
      },
      "dataDiskImages": [
        {
          "source": {
            "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{diskSnapshotName}"
          },
          "lun": 1,
          "sizeInGB": 10,
          "hostCaching": "None"
        }
      ]
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "1.0.0"
}
{
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "storageAccountType": "Standard_LRS",
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "lun": 1,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ],
      "replicaCount": 1,
      "publishedDate": "2018-01-01T00:00:00Z",
      "storageAccountType": "Standard_LRS"
    },
    "storageProfile": {
      "osDiskImage": {
        "source": {
          "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"
        },
        "sizeInGB": 10,
        "hostCaching": "ReadOnly"
      },
      "dataDiskImages": [
        {
          "source": {
            "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{diskSnapshotName}"
          },
          "lun": 1,
          "sizeInGB": 10,
          "hostCaching": "None"
        }
      ]
    },
    "provisioningState": "Creating"
  },
  "location": "West US",
  "name": "1.0.0"
}
{
  "properties": {
    "publishingProfile": {
      "targetRegions": [
        {
          "name": "West US",
          "regionalReplicaCount": 1,
          "storageAccountType": "Standard_LRS",
          "encryption": {
            "osDiskImage": {
              "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"
            },
            "dataDiskImages": [
              {
                "lun": 1,
                "diskEncryptionSetId": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"
              }
            ]
          }
        },
        {
          "name": "East US",
          "regionalReplicaCount": 2,
          "storageAccountType": "Standard_ZRS"
        }
      ],
      "replicaCount": 1,
      "publishedDate": "2018-01-01T00:00:00Z",
      "storageAccountType": "Standard_LRS"
    },
    "storageProfile": {
      "osDiskImage": {
        "source": {
          "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"
        },
        "sizeInGB": 10,
        "hostCaching": "ReadOnly"
      },
      "dataDiskImages": [
        {
          "source": {
            "id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{diskSnapshotName}"
          },
          "lun": 1,
          "sizeInGB": 10,
          "hostCaching": "None"
        }
      ]
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "1.0.0"
}

Definitions

AggregatedReplicationState

This is the aggregated replication status based on all the regional replication status flags.

ApiError

Api error.

ApiErrorBase

Api error base.

CloudError

An error response from the Compute service.

DataDiskImageEncryption

Contains encryption settings for a data disk image.

EncryptionImages

Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact.

GalleryArtifactVersionSource

The gallery artifact version source.

GalleryDataDiskImage

This is the data disk image.

GalleryImageVersion

Specifies information about the gallery Image Version that you want to create or update.

GalleryImageVersionPublishingProfile

The publishing profile of a gallery Image Version.

GalleryImageVersionStorageProfile

This is the storage profile of a Gallery Image Version.

GalleryOSDiskImage

This is the OS disk image.

HostCaching

The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'

InnerError

Inner error details.

OSDiskImageEncryption

Contains encryption settings for an OS disk image.

RegionalReplicationStatus

This is the regional replication status.

ReplicationState

This is the regional replication state.

ReplicationStatus

This is the replication status of the gallery Image Version.

StorageAccountType

Specifies the storage account type to be used to store the image. This property is not updatable.

TargetRegion

Describes the target region information.

AggregatedReplicationState

This is the aggregated replication status based on all the regional replication status flags.

Name Type Description
Completed
  • string
Failed
  • string
InProgress
  • string
Unknown
  • string

ApiError

Api error.

Name Type Description
code
  • string

The error code.

details

The Api error details

innererror

The Api inner error

message
  • string

The error message.

target
  • string

The target of the particular error.

ApiErrorBase

Api error base.

Name Type Description
code
  • string

The error code.

message
  • string

The error message.

target
  • string

The target of the particular error.

CloudError

An error response from the Compute service.

Name Type Description
error

Api error.

DataDiskImageEncryption

Contains encryption settings for a data disk image.

Name Type Description
diskEncryptionSetId
  • string

A relative URI containing the resource ID of the disk encryption set.

lun
  • integer

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

Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact.

Name Type Description
dataDiskImages

A list of encryption specifications for data disk images.

osDiskImage

Contains encryption settings for an OS disk image.

GalleryArtifactVersionSource

The gallery artifact version source.

Name Type Description
id
  • string

The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image.

GalleryDataDiskImage

This is the data disk image.

Name Type Description
hostCaching

The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'

lun
  • integer

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.

sizeInGB
  • integer

This property indicates the size of the VHD to be created.

source

The gallery artifact version source.

GalleryImageVersion

Specifies information about the gallery Image Version that you want to create or update.

Name Type Description
id
  • string

Resource Id

location
  • string

Resource location

name
  • string

Resource name

properties.provisioningState enum:
  • Creating
  • Deleting
  • Failed
  • Migrating
  • Succeeded
  • Updating

The current state of the gallery Image Version.
The provisioning state, which only appears in the response.

properties.publishingProfile

The publishing profile of a gallery Image Version.

properties.replicationStatus

This is the replication status of the gallery Image Version.

properties.storageProfile

This is the storage profile of a Gallery Image Version.

tags
  • object

Resource tags

type
  • string

Resource type

GalleryImageVersionPublishingProfile

The publishing profile of a gallery Image Version.

Name Type Description
endOfLifeDate
  • string

The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable.

excludeFromLatest
  • boolean

If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.

publishedDate
  • string

The timestamp for when the gallery Image Version is published.

replicaCount
  • integer

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.

storageAccountType

Specifies the storage account type to be used to store the image. This property is not updatable.

targetRegions

The target regions where the Image Version is going to be replicated to. This property is updatable.

GalleryImageVersionStorageProfile

This is the storage profile of a Gallery Image Version.

Name Type Description
dataDiskImages

A list of data disk images.

osDiskImage

This is the OS disk image.

source

The gallery artifact version source.

GalleryOSDiskImage

This is the OS disk image.

Name Type Description
hostCaching

The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'

sizeInGB
  • integer

This property indicates the size of the VHD to be created.

source

The gallery artifact version source.

HostCaching

The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'

Name Type Description
None
  • string
ReadOnly
  • string
ReadWrite
  • string

InnerError

Inner error details.

Name Type Description
errordetail
  • string

The internal error message or exception dump.

exceptiontype
  • string

The exception type.

OSDiskImageEncryption

Contains encryption settings for an OS disk image.

Name Type Description
diskEncryptionSetId
  • string

A relative URI containing the resource ID of the disk encryption set.

RegionalReplicationStatus

This is the regional replication status.

Name Type Description
details
  • string

The details of the replication status.

progress
  • integer

It indicates progress of the replication job.

region
  • string

The region to which the gallery Image Version is being replicated to.

state

This is the regional replication state.

ReplicationState

This is the regional replication state.

Name Type Description
Completed
  • string
Failed
  • string
Replicating
  • string
Unknown
  • string

ReplicationStatus

This is the replication status of the gallery Image Version.

Name Type Description
aggregatedState

This is the aggregated replication status based on all the regional replication status flags.

summary

This is a summary of replication status for each region.

StorageAccountType

Specifies the storage account type to be used to store the image. This property is not updatable.

Name Type Description
Premium_LRS
  • string
Standard_LRS
  • string
Standard_ZRS
  • string

TargetRegion

Describes the target region information.

Name Type Description
encryption

Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact.

name
  • string

The name of the region.

regionalReplicaCount
  • integer

The number of replicas of the Image Version to be created per region. This property is updatable.

storageAccountType

Specifies the storage account type to be used to store the image. This property is not updatable.