Galleries - Create Or Update
Create or update a Shared Image Gallery.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}?api-version=2024-03-03
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
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 |
| identity |
The identity of the gallery, if configured. |
||
| properties.description |
string |
The description of this Shared Image Gallery resource. This property is updatable. |
|
| properties.identifier |
Describes the gallery unique name. |
||
| properties.sharingProfile |
Profile for gallery sharing to subscription or tenant |
||
| properties.softDeletePolicy |
Contains information about the soft deletion policy of the gallery. |
||
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Resource 'Gallery' update operation succeeded |
|
| 201 Created |
Resource 'Gallery' 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 a community gallery.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2024-03-03
{
"location": "West US",
"properties": {
"description": "This is the gallery description.",
"sharingProfile": {
"permissions": "Community",
"communityGalleryInfo": {
"publisherUri": "uri",
"publisherContact": "pir@microsoft.com",
"eula": "eula",
"publicNamePrefix": "PirPublic"
}
}
}
}
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating",
"sharingProfile": {
"permissions": "Community",
"communityGalleryInfo": {
"publisherUri": "uri",
"publisherContact": "pir@microsoft.com",
"eula": "eula",
"publicNamePrefix": "PirPublic"
}
}
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Creating",
"sharingProfile": {
"permissions": "Community",
"communityGalleryInfo": {
"publisherUri": "uri",
"publisherContact": "pir@microsoft.com",
"eula": "eula",
"publicNamePrefix": "PirPublic"
}
}
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating",
"sharingProfile": {
"permissions": "Community",
"communityGalleryInfo": {
"publisherUri": "uri",
"publisherContact": "pir@microsoft.com",
"eula": "eula",
"publicNamePrefix": "PirPublic"
}
}
},
"location": "West US",
"name": "myGalleryName"
}
Create or update a simple gallery with sharing profile.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2024-03-03
{
"location": "West US",
"properties": {
"description": "This is the gallery description.",
"sharingProfile": {
"permissions": "Groups"
}
}
}
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating",
"sharingProfile": {
"permissions": "Groups"
}
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Creating",
"sharingProfile": {
"permissions": "Groups"
}
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating",
"sharingProfile": {
"permissions": "Groups"
}
},
"location": "West US",
"name": "myGalleryName"
}
Create or update a simple gallery with soft deletion enabled.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2024-03-03
{
"location": "West US",
"properties": {
"description": "This is the gallery description.",
"softDeletePolicy": {
"isSoftDeleteEnabled": true
}
}
}
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating",
"softDeletePolicy": {
"isSoftDeleteEnabled": true
}
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Creating",
"softDeletePolicy": {
"isSoftDeleteEnabled": true
}
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating",
"softDeletePolicy": {
"isSoftDeleteEnabled": true
}
},
"location": "West US",
"name": "myGalleryName"
}
Create or update a simple gallery with system-assigned and user-assigned managed identities.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2024-03-03
{
"location": "West US",
"identity": {
"type": "SystemAssigned, UserAssigned",
"userAssignedIdentities": {
"/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}
}
},
"properties": {
"description": "This is the gallery description."
}
}
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"userAssignedIdentities": {
"/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}
}
},
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"userAssignedIdentities": {
"/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}
}
},
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Creating",
"softDeletePolicy": {
"isSoftDeleteEnabled": true
}
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"identity": {
"type": "SystemAssigned, UserAssigned",
"principalId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"userAssignedIdentities": {
"/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}
}
},
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating",
"softDeletePolicy": {
"isSoftDeleteEnabled": true
}
},
"location": "West US",
"name": "myGalleryName"
}
Create or update a simple gallery.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2024-03-03
{
"location": "West US",
"properties": {
"description": "This is the gallery description."
}
}
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Creating"
},
"location": "West US",
"name": "myGalleryName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "myGalleryName"
}
Definitions
| Name | Description |
|---|---|
|
Api |
Api error. |
|
Api |
Api error base. |
|
Cloud |
An error response from the Compute service. |
|
Common. |
|
|
Community |
Information of community gallery if current gallery is shared to community |
|
created |
The type of identity that created the resource. |
| Gallery |
Specifies information about the Shared Image Gallery that you want to create or update. |
|
Gallery |
Describes the gallery unique name. |
|
Gallery |
Identity for the virtual machine. |
|
Gallery |
The provisioning state, which only appears in the response. |
|
Gallery |
This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community. |
|
Inner |
Inner error details. |
|
Regional |
Gallery regional sharing status |
|
Resource |
The type of identity used for the gallery. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove all identities from the gallery. |
|
Sharing |
Profile for gallery sharing to subscription or tenant |
|
Sharing |
Group of the gallery sharing profile |
|
Sharing |
This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants. |
|
Sharing |
The sharing state of the gallery, which only appears in the response. |
|
Sharing |
Sharing status of current gallery. |
|
Soft |
Contains information about the soft deletion policy of the gallery. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
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. |
Common.UserAssignedIdentitiesValue
| Name | Type | Description |
|---|---|---|
| clientId |
string |
The client id of user assigned identity. |
| principalId |
string |
The principal id of user assigned identity. |
CommunityGalleryInfo
Information of community gallery if current gallery is shared to community
| Name | Type | Description |
|---|---|---|
| communityGalleryEnabled |
boolean |
Contains info about whether community gallery sharing is enabled. |
| eula |
string |
End-user license agreement for community gallery image. |
| publicNamePrefix |
string |
The prefix of the gallery name that will be displayed publicly. Visible to all users. |
| publicNames |
string[] |
Community gallery public name list. |
| publisherContact |
string |
Community gallery publisher support email. The email address of the publisher. Visible to all users. |
| publisherUri |
string |
The link to the publisher website. Visible to all users. |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
Gallery
Specifies information about the Shared Image Gallery 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} |
| identity |
The identity of the gallery, if configured. |
|
| location |
string |
The geo-location where the resource lives |
| name |
string |
The name of the resource |
| properties.description |
string |
The description of this Shared Image Gallery resource. This property is updatable. |
| properties.identifier |
Describes the gallery unique name. |
|
| properties.provisioningState |
The provisioning state, which only appears in the response. |
|
| properties.sharingProfile |
Profile for gallery sharing to subscription or tenant |
|
| properties.sharingStatus |
Sharing status of current gallery. |
|
| properties.softDeletePolicy |
Contains information about the soft deletion policy of the gallery. |
|
| 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" |
GalleryIdentifier
Describes the gallery unique name.
| Name | Type | Description |
|---|---|---|
| uniqueName |
string |
The unique name of the Shared Image Gallery. This name is generated automatically by Azure. |
GalleryIdentity
Identity for the virtual machine.
| Name | Type | Description |
|---|---|---|
| principalId |
string |
The principal id of the gallery identity. This property will only be provided for a system assigned identity. |
| tenantId |
string |
The AAD tenant id of the gallery identity. This property will only be provided for a system assigned identity. |
| type |
The type of identity used for the gallery. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove all identities from the gallery. |
|
| userAssignedIdentities |
<string,
Common. |
The list of user identities associated with the gallery. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. |
GalleryProvisioningState
The provisioning state, which only appears in the response.
| Value | Description |
|---|---|
| Creating | |
| Updating | |
| Failed | |
| Succeeded | |
| Deleting | |
| Migrating |
GallerySharingPermissionTypes
This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community.
| Value | Description |
|---|---|
| Private | |
| Groups | |
| Community |
InnerError
Inner error details.
| Name | Type | Description |
|---|---|---|
| errordetail |
string |
The internal error message or exception dump. |
| exceptiontype |
string |
The exception type. |
RegionalSharingStatus
Gallery regional sharing status
| Name | Type | Description |
|---|---|---|
| details |
string |
Details of gallery regional sharing failure. |
| region |
string |
Region name |
| state |
Gallery sharing state in current region |
ResourceIdentityType
The type of identity used for the gallery. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove all identities from the gallery.
| Value | Description |
|---|---|
| SystemAssigned | |
| UserAssigned | |
| SystemAssigned, UserAssigned | |
| None |
SharingProfile
Profile for gallery sharing to subscription or tenant
| Name | Type | Description |
|---|---|---|
| communityGalleryInfo |
Information of community gallery if current gallery is shared to community. |
|
| groups |
A list of sharing profile groups. |
|
| permissions |
This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community. |
SharingProfileGroup
Group of the gallery sharing profile
| Name | Type | Description |
|---|---|---|
| ids |
string[] |
A list of subscription/tenant ids the gallery is aimed to be shared to. |
| type |
This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants. |
SharingProfileGroupTypes
This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants.
| Value | Description |
|---|---|
| Subscriptions | |
| AADTenants |
SharingState
The sharing state of the gallery, which only appears in the response.
| Value | Description |
|---|---|
| Succeeded | |
| InProgress | |
| Failed | |
| Unknown |
SharingStatus
Sharing status of current gallery.
| Name | Type | Description |
|---|---|---|
| aggregatedState |
Aggregated sharing state of current gallery. |
|
| summary |
Summary of all regional sharing status. |
SoftDeletePolicy
Contains information about the soft deletion policy of the gallery.
| Name | Type | Description |
|---|---|---|
| isSoftDeleteEnabled |
boolean |
Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. |
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. |