你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
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=2023-07-03
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
gallery
|
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. |
gallery
|
path | True |
string |
The name of the Shared Image Gallery in which the Image Definition is to be created. |
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
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.architecture |
The architecture of the image. Applicable to OS disks only. |
||
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.features |
A list of gallery image features. |
||
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
Create or update a simple gallery image.
Sample request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName?api-version=2023-07-03
{
"location": "West US",
"properties": {
"osType": "Windows",
"osState": "Generalized",
"hyperVGeneration": "V1",
"identifier": {
"publisher": "myPublisherName",
"offer": "myOfferName",
"sku": "mySkuName"
}
}
}
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName",
"properties": {
"osType": "Windows",
"osState": "Generalized",
"hyperVGeneration": "V1",
"identifier": {
"publisher": "myPublisherName",
"offer": "myOfferName",
"sku": "mySkuName"
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "myGalleryImageName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName",
"properties": {
"osType": "Windows",
"osState": "Generalized",
"hyperVGeneration": "V1",
"identifier": {
"publisher": "myPublisherName",
"offer": "myOfferName",
"sku": "mySkuName"
},
"provisioningState": "Creating"
},
"location": "West US",
"name": "myGalleryImageName"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName",
"properties": {
"osType": "Windows",
"osState": "Generalized",
"hyperVGeneration": "V1",
"identifier": {
"publisher": "myPublisherName",
"offer": "myOfferName",
"sku": "mySkuName"
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "myGalleryImageName"
}
Definitions
Name | Description |
---|---|
Api |
Api error. |
Api |
Api error base. |
Architecture |
The architecture of the image. Applicable to OS disks only. |
Cloud |
An error response from the Compute service. |
Disallowed |
Describes the disallowed disk types. |
Gallery |
Specifies information about the gallery image definition that you want to create or update. |
Gallery |
A feature for gallery image. |
Gallery |
This is the gallery image definition identifier. |
Gallery |
The current state of the gallery or gallery artifact. |
Hyper |
The hypervisor generation of the Virtual Machine. Applicable to OS disks only. |
Image |
Describes the gallery image definition purchase plan. This is used by marketplace images. |
Inner |
Inner error details. |
Operating |
This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. |
Operating |
This property allows you to specify the supported type of the OS that application is built for. Possible values are: Windows, Linux. |
Recommended |
The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. |
Resource |
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. |
Architecture
The architecture of the image. Applicable to OS disks only.
Name | Type | Description |
---|---|---|
Arm64 |
string |
|
x64 |
string |
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.architecture |
The architecture of the image. Applicable to OS disks only. |
|
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.features |
A list of gallery image features. |
|
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 |
The current state of the gallery or gallery artifact. |
|
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 |
GalleryImageFeature
A feature for gallery image.
Name | Type | Description |
---|---|---|
name |
string |
The name of the gallery image feature. |
value |
string |
The value of the gallery image feature. |
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. |
GalleryProvisioningState
The current state of the gallery or gallery artifact.
Name | Type | Description |
---|---|---|
Creating |
string |
|
Deleting |
string |
|
Failed |
string |
|
Migrating |
string |
|
Succeeded |
string |
|
Updating |
string |
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. |