Gallery Images - Create Or Update

Create or update a gallery Image Definition.

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

URI Parameters

Name In Required Type Description
galleryImageName
path True
  • string

The name of the gallery Image Definition to be created or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.

galleryName
path True
  • string

The name of the Shared Image Gallery in which the Image Definition is to be created.

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.identifier True

This is the gallery Image Definition identifier.

properties.osState True

This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'.

properties.osType True

This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

Windows

Linux

properties.description
  • string

The description of this gallery Image Definition resource. This property is updatable.

properties.disallowed

Describes the disallowed disk types.

properties.endOfLifeDate
  • string

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

properties.eula
  • string

The Eula agreement for the gallery Image Definition.

properties.hyperVGeneration

The hypervisor generation of the Virtual Machine. Applicable to OS disks only.

properties.privacyStatementUri
  • string

The privacy statement uri.

properties.purchasePlan

Describes the gallery Image Definition purchase plan. This is used by marketplace images.

properties.recommended

The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.

properties.releaseNoteUri
  • string

The release note uri.

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

Sample Request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName?api-version=2019-12-01
{
  "location": "West US",
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    }
  }
}

Sample Response

{
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "myGalleryImageName"
}
{
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    },
    "provisioningState": "Creating"
  },
  "location": "West US",
  "name": "myGalleryImageName"
}
{
  "properties": {
    "osType": "Windows",
    "osState": "Generalized",
    "hyperVGeneration": "V1",
    "identifier": {
      "publisher": "myPublisherName",
      "offer": "myOfferName",
      "sku": "mySkuName"
    },
    "provisioningState": "Updating"
  },
  "location": "West US",
  "name": "myGalleryImageName"
}

Definitions

ApiError

Api error.

ApiErrorBase

Api error base.

CloudError

An error response from the Compute service.

Disallowed

Describes the disallowed disk types.

GalleryImage

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

GalleryImageIdentifier

This is the gallery Image Definition identifier.

HyperVGeneration

The hypervisor generation of the Virtual Machine. Applicable to OS disks only.

ImagePurchasePlan

Describes the gallery Image Definition purchase plan. This is used by marketplace images.

InnerError

Inner error details.

OperatingSystemStateTypes

This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'.

OperatingSystemTypes

This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

Windows

Linux

RecommendedMachineConfiguration

The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.

ResourceRange

Describes the resource range.

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.

Disallowed

Describes the disallowed disk types.

Name Type Description
diskTypes
  • string[]

A list of disk types.

GalleryImage

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

Name Type Description
id
  • string

Resource Id

location
  • string

Resource location

name
  • string

Resource name

properties.description
  • string

The description of this gallery Image Definition resource. This property is updatable.

properties.disallowed

Describes the disallowed disk types.

properties.endOfLifeDate
  • string

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

properties.eula
  • string

The Eula agreement for the gallery Image Definition.

properties.hyperVGeneration

The hypervisor generation of the Virtual Machine. Applicable to OS disks only.

properties.identifier

This is the gallery Image Definition identifier.

properties.osState

This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'.

properties.osType

This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

Windows

Linux

properties.privacyStatementUri
  • string

The privacy statement uri.

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

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

properties.purchasePlan

Describes the gallery Image Definition purchase plan. This is used by marketplace images.

properties.recommended

The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.

properties.releaseNoteUri
  • string

The release note uri.

tags
  • object

Resource tags

type
  • string

Resource type

GalleryImageIdentifier

This is the gallery Image Definition identifier.

Name Type Description
offer
  • string

The name of the gallery Image Definition offer.

publisher
  • string

The name of the gallery Image Definition publisher.

sku
  • string

The name of the gallery Image Definition SKU.

HyperVGeneration

The hypervisor generation of the Virtual Machine. Applicable to OS disks only.

Name Type Description
V1
  • string
V2
  • string

ImagePurchasePlan

Describes the gallery Image Definition purchase plan. This is used by marketplace images.

Name Type Description
name
  • string

The plan ID.

product
  • string

The product ID.

publisher
  • string

The publisher ID.

InnerError

Inner error details.

Name Type Description
errordetail
  • string

The internal error message or exception dump.

exceptiontype
  • string

The exception type.

OperatingSystemStateTypes

This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'.

Name Type Description
Generalized
  • string
Specialized
  • string

OperatingSystemTypes

This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

Windows

Linux

Name Type Description
Linux
  • string
Windows
  • string

RecommendedMachineConfiguration

The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.

Name Type Description
memory

Describes the resource range.

vCPUs

Describes the resource range.

ResourceRange

Describes the resource range.

Name Type Description
max
  • integer

The maximum number of the resource.

min
  • integer

The minimum number of the resource.