Gallery Application Versions - Create Or Update
Create or update a gallery Application Version.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}?api-version=2025-03-03
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
gallery
|
path | True |
string |
The name of the gallery Application Definition to be retrieved. |
|
gallery
|
path | True |
string |
The name of the gallery Application Version to be retrieved. |
|
gallery
|
path | True |
string pattern: ^[^_\W][\w-._]{0,79}(? |
The name of the Shared Image Gallery. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string minLength: 1 |
The ID of the target subscription. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| location | True |
string |
The geo-location where the resource lives |
| properties.publishingProfile | True |
The publishing profile of a gallery image version. |
|
| properties.safetyProfile |
The safety profile of the Gallery Application Version. |
||
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Resource 'GalleryApplicationVersion' update operation succeeded |
|
| 201 Created |
Resource 'GalleryApplicationVersion' create operation succeeded Headers
|
|
| 202 Accepted |
The request has been accepted for processing, but processing has not yet completed. Headers
|
|
| Other Status Codes |
An unexpected error response. |
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 Application Version.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName/versions/1.0.0?api-version=2025-03-03
{
"location": "West US",
"properties": {
"publishingProfile": {
"source": {
"mediaLink": "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"
},
"manageActions": {
"install": "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"",
"remove": "del C:\\package "
},
"targetRegions": [
{
"name": "West US",
"regionalReplicaCount": 1,
"storageAccountType": "Standard_LRS",
"excludeFromLatest": false
}
],
"replicaCount": 1,
"endOfLifeDate": "2019-07-01T07:00:00Z",
"storageAccountType": "Standard_LRS",
"customActions": [
{
"name": "myCustomAction",
"script": "myCustomActionScript",
"description": "This is the custom action description.",
"parameters": [
{
"name": "myCustomActionParameter",
"required": false,
"type": "String",
"defaultValue": "default value of parameter.",
"description": "This is the description of the parameter"
}
]
}
]
},
"safetyProfile": {
"allowDeletionOfReplicatedLocations": false
}
}
}
Sample response
{
"location": "West US",
"name": "1.0.0",
"type": "Microsoft.Compute/galleries/applications/versions",
"id": "/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0",
"properties": {
"publishingProfile": {
"source": {
"mediaLink": "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"
},
"manageActions": {
"install": "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"",
"remove": "del C:\\package "
},
"enableHealthCheck": false,
"settings": {
"packageFileName": "package.zip",
"configFileName": "configuration.cfg"
},
"advancedSettings": {
"timeout": "300",
"user": "root"
},
"targetRegions": [
{
"name": "West US",
"regionalReplicaCount": 1,
"storageAccountType": "Standard_LRS",
"excludeFromLatest": false
}
],
"replicaCount": 1,
"excludeFromLatest": false,
"publishedDate": "2019-06-21T17:13:57.5972568+00:00",
"endOfLifeDate": "2019-07-01T07:00:00+00:00",
"storageAccountType": "Standard_LRS",
"customActions": [
{
"name": "myCustomAction",
"script": "myCustomActionScript",
"description": "This is the custom action description.",
"parameters": [
{
"name": "myCustomActionParameter",
"required": false,
"type": "String",
"defaultValue": "default value of parameter.",
"description": "This is the description of the parameter"
}
]
}
]
},
"safetyProfile": {
"allowDeletionOfReplicatedLocations": false
},
"provisioningState": "Updating"
}
}
{
"location": "West US",
"name": "1.0.0",
"type": "Microsoft.Compute/galleries/applications/versions",
"id": "/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0",
"properties": {
"publishingProfile": {
"source": {
"mediaLink": "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"
},
"manageActions": {
"install": "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"",
"remove": "del C:\\package "
},
"enableHealthCheck": false,
"settings": {
"packageFileName": "package.zip",
"configFileName": "configuration.cfg",
"scriptBehaviorAfterReboot": "Rerun"
},
"advancedSettings": {
"timeout": "300",
"user": "root"
},
"targetRegions": [
{
"name": "West US",
"regionalReplicaCount": 1,
"storageAccountType": "Standard_LRS",
"excludeFromLatest": false
}
],
"replicaCount": 1,
"excludeFromLatest": false,
"publishedDate": "2019-06-21T17:13:57.5972568+00:00",
"endOfLifeDate": "2019-07-01T07:00:00+00:00",
"storageAccountType": "Standard_LRS",
"customActions": [
{
"name": "myCustomAction",
"script": "myCustomActionScript",
"description": "This is the custom action description.",
"parameters": [
{
"name": "myCustomActionParameter",
"required": false,
"type": "String",
"defaultValue": "default value of parameter.",
"description": "This is the description of the parameter"
}
]
}
]
},
"safetyProfile": {
"allowDeletionOfReplicatedLocations": false
},
"provisioningState": "Creating"
}
}
{
"location": "West US",
"name": "1.0.0",
"type": "Microsoft.Compute/galleries/applications/versions",
"id": "/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0",
"properties": {
"publishingProfile": {
"source": {
"mediaLink": "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"
},
"manageActions": {
"install": "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"",
"remove": "del C:\\package "
},
"enableHealthCheck": false,
"targetRegions": [
{
"name": "West US",
"regionalReplicaCount": 1,
"storageAccountType": "Standard_LRS",
"excludeFromLatest": false
}
],
"replicaCount": 1,
"excludeFromLatest": false,
"publishedDate": "2019-06-21T17:13:57.5972568+00:00",
"endOfLifeDate": "2019-07-01T07:00:00+00:00",
"storageAccountType": "Standard_LRS",
"customActions": [
{
"name": "myCustomAction",
"script": "myCustomActionScript",
"description": "This is the custom action description.",
"parameters": [
{
"name": "myCustomActionParameter",
"required": false,
"type": "String",
"defaultValue": "default value of parameter.",
"description": "This is the description of the parameter"
}
]
}
]
},
"safetyProfile": {
"allowDeletionOfReplicatedLocations": false
},
"provisioningState": "Updating"
}
}
Definitions
| Name | Description |
|---|---|
|
Additional |
Describes the additional replica set information. |
|
Aggregated |
This is the aggregated replication status based on all the regional replication status flags. |
|
Api |
Api error. |
|
Api |
Api error base. |
|
Cloud |
An error response from the Compute service. |
|
Confidential |
confidential VM encryption types |
|
created |
The type of identity that created the resource. |
|
Data |
Contains encryption settings for a data disk image. |
|
Edge |
Specifies the storage account type to be used to store the image. This property is not updatable. |
|
Encryption |
Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. |
|
Gallery |
A custom action that can be performed with a Gallery Application Version. |
|
Gallery |
The definition of a parameter that can be passed to a custom action of a Gallery Application Version. |
|
Gallery |
Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob |
|
Gallery |
Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot. |
|
Gallery |
Specifies information about the gallery Application Version that you want to create or update. |
|
Gallery |
The publishing profile of a gallery image version. |
|
Gallery |
The safety profile of the Gallery Application Version. |
|
Gallery |
The name of the extended location. |
|
Gallery |
It is type of the extended location. |
|
Gallery |
The provisioning state, which only appears in the response. |
|
Gallery |
|
|
Inner |
Inner error details. |
|
OSDisk |
Contains encryption settings for an OS disk image. |
|
OSDisk |
Contains security profile for an OS disk image. |
|
Regional |
This is the regional replication status. |
|
Replication |
Optional parameter which specifies the mode to be used for replication. This property is not updatable. |
|
Replication |
This is the regional replication state. |
|
Replication |
This is the replication status of the gallery image version. |
|
Storage |
Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property is not updatable. |
|
Storage |
Specifies the storage account type to be used to store the image. This property is not updatable. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
|
Target |
Describes the target region information. |
|
User |
|
|
User |
Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set. |
|
User |
The source image from which the Image Version is going to be created. |
AdditionalReplicaSet
Describes the additional replica set information.
| Name | Type | Description |
|---|---|---|
| regionalReplicaCount |
integer (int32) |
The number of direct drive replicas of the Image Version to be created.This Property is updatable |
| storageAccountType |
Specifies the storage account type to be used to create the direct drive replicas |
AggregatedReplicationState
This is the aggregated replication status based on all the regional replication status flags.
| Value | Description |
|---|---|
| Unknown | |
| InProgress | |
| Completed | |
| Failed |
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. |
ConfidentialVMEncryptionType
confidential VM encryption types
| Value | Description |
|---|---|
| EncryptedVMGuestStateOnlyWithPmk | |
| EncryptedWithPmk | |
| EncryptedWithCmk | |
| NonPersistedTPM |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
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 (int32) |
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. |
EdgeZoneStorageAccountType
Specifies the storage account type to be used to store the image. This property is not updatable.
| Value | Description |
|---|---|
| Standard_LRS | |
| Standard_ZRS | |
| StandardSSD_LRS | |
| Premium_LRS |
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. |
GalleryApplicationCustomAction
A custom action that can be performed with a Gallery Application Version.
| Name | Type | Description |
|---|---|---|
| description |
string |
Description to help the users understand what this custom action does. |
| name |
string |
The name of the custom action. Must be unique within the Gallery Application Version. |
| parameters |
The parameters that this custom action uses |
|
| script |
string |
The script to run when executing this custom action. |
GalleryApplicationCustomActionParameter
The definition of a parameter that can be passed to a custom action of a Gallery Application Version.
| Name | Type | Description |
|---|---|---|
| defaultValue |
string |
The default value of the parameter. Only applies to string types |
| description |
string |
A description to help users understand what this parameter means |
| name |
string |
The name of the custom action. Must be unique within the Gallery Application Version. |
| required |
boolean |
Indicates whether this parameter must be passed when running the custom action. |
| type |
Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob |
GalleryApplicationCustomActionParameterType
Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob
| Value | Description |
|---|---|
| String | |
| ConfigurationDataBlob | |
| LogOutputBlob |
GalleryApplicationScriptRebootBehavior
Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot.
| Value | Description |
|---|---|
| None | |
| Rerun |
GalleryApplicationVersion
Specifies information about the gallery Application Version that you want to create or update.
| Name | Type | Description |
|---|---|---|
| id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| location |
string |
The geo-location where the resource lives |
| name |
string |
The name of the resource |
| properties.provisioningState |
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.safetyProfile |
The safety profile of the Gallery Application Version. |
|
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| tags |
object |
Resource tags. |
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
GalleryApplicationVersionPublishingProfile
The publishing profile of a gallery image version.
| Name | Type | Description |
|---|---|---|
| advancedSettings |
object |
Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. |
| customActions |
A list of custom actions that can be performed with this Gallery Application Version. |
|
| enableHealthCheck |
boolean |
Optional. Whether or not this application reports health. |
| endOfLifeDate |
string (date-time) |
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. |
| manageActions | ||
| publishedDate |
string (date-time) |
The timestamp for when the gallery image version is published. |
| replicaCount |
integer (int32) |
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. |
| replicationMode |
Optional parameter which specifies the mode to be used for replication. This property is not updatable. |
|
| settings |
Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set. |
|
| source |
The source image from which the Image Version is going to be created. |
|
| storageAccountStrategy |
Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property is not updatable. |
|
| storageAccountType |
Specifies the storage account type to be used to store the image. Cannot be specified along with storageAccountStrategy. This property is not updatable. |
|
| targetExtendedLocations |
The target extended locations where the Image Version is going to be replicated to. This property is updatable. |
|
| targetRegions |
The target regions where the Image Version is going to be replicated to. This property is updatable. |
GalleryApplicationVersionSafetyProfile
The safety profile of the Gallery Application Version.
| Name | Type | Description |
|---|---|---|
| allowDeletionOfReplicatedLocations |
boolean |
Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. |
GalleryExtendedLocation
The name of the extended location.
| Name | Type | Description |
|---|---|---|
| name |
string |
|
| type |
It is type of the extended location. |
GalleryExtendedLocationType
It is type of the extended location.
| Value | Description |
|---|---|
| EdgeZone | |
| Unknown |
GalleryProvisioningState
The provisioning state, which only appears in the response.
| Value | Description |
|---|---|
| Creating | |
| Updating | |
| Failed | |
| Succeeded | |
| Deleting | |
| Migrating |
GalleryTargetExtendedLocation
| Name | Type | Description |
|---|---|---|
| encryption |
Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. |
|
| extendedLocation |
The name of the extended location. |
|
| extendedLocationReplicaCount |
integer (int32) |
The number of replicas of the Image Version to be created per extended location. This property is updatable. |
| name |
string |
The name of the region. |
| storageAccountType |
Specifies the storage account type to be used to store the image. This property is not updatable. |
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. |
| securityProfile |
This property specifies the security profile of an OS disk image. |
OSDiskImageSecurityProfile
Contains security profile for an OS disk image.
| Name | Type | Description |
|---|---|---|
| confidentialVMEncryptionType |
confidential VM encryption types |
|
| secureVMDiskEncryptionSetId |
string |
secure VM disk encryption set id |
RegionalReplicationStatus
This is the regional replication status.
| Name | Type | Description |
|---|---|---|
| details |
string |
The details of the replication status. |
| progress |
integer (int32) |
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. |
ReplicationMode
Optional parameter which specifies the mode to be used for replication. This property is not updatable.
| Value | Description |
|---|---|
| Full | |
| Shallow |
ReplicationState
This is the regional replication state.
| Value | Description |
|---|---|
| Unknown | |
| Replicating | |
| Completed | |
| Failed |
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. |
StorageAccountStrategy
Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property is not updatable.
| Value | Description |
|---|---|
| PreferStandard_ZRS |
Choose Standard_ZRS storage if the region supports it, else choose Standard_LRS storage, unless overridden by specifying regional storageAccountType. If no storageAccountStrategy is specified, this is the default strategy (from API version 2025-03-03 onwards). |
| DefaultStandard_LRS |
Choose Standard_LRS storage unless overridden by specifying regional storageAccountType. |
StorageAccountType
Specifies the storage account type to be used to store the image. This property is not updatable.
| Value | Description |
|---|---|
| Standard_LRS | |
| Standard_ZRS | |
| Premium_LRS | |
| PremiumV2_LRS |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |
TargetRegion
Describes the target region information.
| Name | Type | Description |
|---|---|---|
| additionalReplicaSets |
List of storage sku with replica count to create direct drive replicas. |
|
| encryption |
Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. |
|
| excludeFromLatest |
boolean |
Contains the flag setting to hide an image when users specify version='latest' |
| name |
string |
The name of the region. |
| regionalReplicaCount |
integer (int32) |
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. |
UserArtifactManage
| Name | Type | Description |
|---|---|---|
| install |
string |
Required. The path and arguments to install the gallery application. This is limited to 4096 characters. |
| remove |
string |
Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. |
| update |
string |
Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. |
UserArtifactSettings
Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set.
| Name | Type | Description |
|---|---|---|
| configFileName |
string |
Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, the config file will be named the Gallery Application name appended with "_config". |
| packageFileName |
string |
Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, the package file will be named the same as the Gallery Application name. |
| scriptBehaviorAfterReboot |
Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot. |
UserArtifactSource
The source image from which the Image Version is going to be created.
| Name | Type | Description |
|---|---|---|
| defaultConfigurationLink |
string |
Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. |
| mediaLink |
string |
Required. The mediaLink of the artifact, must be a readable storage page blob. |