Bicep resource definition
The galleries/images resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Usage Examples
Bicep Samples
A basic example of deploying Shared Image within a Shared Image Gallery.
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource gallery 'Microsoft.Compute/galleries@2022-03-03' = {
name: resourceName
location: location
properties: {
description: ''
}
}
resource image 'Microsoft.Compute/galleries/images@2022-03-03' = {
name: resourceName
location: location
parent: gallery
properties: {
architecture: 'x64'
description: ''
disallowed: {
diskTypes: []
}
hyperVGeneration: 'V1'
identifier: {
offer: 'AccTesOffer230630032848825313'
publisher: 'AccTesPublisher230630032848825313'
sku: 'AccTesSku230630032848825313'
}
osState: 'Generalized'
osType: 'Linux'
privacyStatementUri: ''
recommended: {
memory: {}
vCPUs: {}
}
releaseNoteUri: ''
}
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
| Bicep File |
Description |
| Azure Image Builder with Azure Windows Baseline |
Creates an Azure Image Builder environment and builds a Windows Server image with the latest Windows Updates and Azure Windows Baseline applied. |
| Configure Dev Box service |
This template would create all Dev Box admin resources as per Dev Box quick start guide (/azure/dev-box/quickstart-create-dev-box). You can view all resources created, or directly go to DevPortal.microsoft.com to create your first Dev Box. |
To create a Microsoft.Compute/galleries/images resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Compute/galleries/images@2026-03-03' = {
parent: resourceSymbolicName
location: 'string'
name: 'string'
properties: {
allowUpdateImage: bool
architecture: 'string'
description: 'string'
disallowed: {
diskTypes: [
'string'
]
}
endOfLifeDate: 'string'
eula: 'string'
features: [
{
name: 'string'
startsAtVersion: 'string'
value: 'string'
}
]
hyperVGeneration: 'string'
identifier: {
offer: 'string'
publisher: 'string'
sku: 'string'
}
osState: 'string'
osType: 'string'
privacyStatementUri: 'string'
purchasePlan: {
name: 'string'
product: 'string'
publisher: 'string'
}
recommended: {
memory: {
max: int
min: int
}
vCPUs: {
max: int
min: int
}
}
releaseNoteUri: 'string'
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.Compute/galleries/images
| Name |
Description |
Value |
| location |
The geo-location where the resource lives |
string (required) |
| name |
The resource name |
string (required) |
| parent |
In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.
For more information, see Child resource outside parent resource. |
Symbolic name for resource of type: galleries |
| properties |
Describes the properties of a gallery image definition. |
GalleryImageProperties |
| tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
Disallowed
| Name |
Description |
Value |
| diskTypes |
A list of disk types. |
string[] |
GalleryImageFeature
| Name |
Description |
Value |
| name |
The name of the gallery image feature. |
string |
| startsAtVersion |
The minimum gallery image version which supports this feature. |
string |
| value |
The value of the gallery image feature. |
string |
GalleryImageIdentifier
| Name |
Description |
Value |
| offer |
The name of the gallery image definition offer. |
string (required) |
| publisher |
The name of the gallery image definition publisher. |
string (required) |
| sku |
The name of the gallery image definition SKU. |
string (required) |
GalleryImageProperties
| Name |
Description |
Value |
| allowUpdateImage |
Optional. Must be set to true if the gallery image features are being updated. |
bool |
| architecture |
The architecture of the image. Applicable to OS disks only. |
'Arm64' 'x64' |
| description |
The description of this gallery image definition resource. This property is updatable. |
string |
| disallowed |
Describes the disallowed disk types. |
Disallowed |
| endOfLifeDate |
The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. |
string |
| eula |
The Eula agreement for the gallery image definition. |
string |
| features |
A list of gallery image features. |
GalleryImageFeature[] |
| hyperVGeneration |
The hypervisor generation of the Virtual Machine. Applicable to OS disks only. |
'V1' 'V2' |
| identifier |
This is the gallery image definition identifier. |
GalleryImageIdentifier (required) |
| osState |
This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. |
'Generalized' 'Specialized' (required) |
| 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. |
'Linux' 'Windows' (required) |
| privacyStatementUri |
The privacy statement uri. |
string |
| purchasePlan |
Describes the gallery image definition purchase plan. This is used by marketplace images. |
ImagePurchasePlan |
| recommended |
The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. |
RecommendedMachineConfiguration |
| releaseNoteUri |
The release note uri. |
string |
ImagePurchasePlan
| Name |
Description |
Value |
| name |
The plan ID. |
string |
| product |
The product ID. |
string |
| publisher |
The publisher ID. |
string |
RecommendedMachineConfiguration
ResourceRange
| Name |
Description |
Value |
| max |
The maximum number of the resource. |
int |
| min |
The minimum number of the resource. |
int |
ARM template resource definition
The galleries/images resource type can be deployed with operations that target:
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
| Template |
Description |
Azure Image Builder with Azure Windows Baseline
 |
Creates an Azure Image Builder environment and builds a Windows Server image with the latest Windows Updates and Azure Windows Baseline applied. |
Configure Dev Box service
 |
This template would create all Dev Box admin resources as per Dev Box quick start guide (/azure/dev-box/quickstart-create-dev-box). You can view all resources created, or directly go to DevPortal.microsoft.com to create your first Dev Box. |
Create an Image Definition in a Azure Compute Gallery
 |
This template allows you to create a simple Image Definition in a Azure Compute Gallery. Please ensure that you have run the Shared Image Gallery 101 Template before you deploy this. |
Gallery image version with UEFI CA 2011 certs
 |
This template creates an Azure Compute Gallery, image definition, and image version from a marketplace Linux image with custom UEFI security profile signatures. |
To create a Microsoft.Compute/galleries/images resource, add the following JSON to your template.
{
"type": "Microsoft.Compute/galleries/images",
"apiVersion": "2026-03-03",
"name": "string",
"location": "string",
"properties": {
"allowUpdateImage": "bool",
"architecture": "string",
"description": "string",
"disallowed": {
"diskTypes": [ "string" ]
},
"endOfLifeDate": "string",
"eula": "string",
"features": [
{
"name": "string",
"startsAtVersion": "string",
"value": "string"
}
],
"hyperVGeneration": "string",
"identifier": {
"offer": "string",
"publisher": "string",
"sku": "string"
},
"osState": "string",
"osType": "string",
"privacyStatementUri": "string",
"purchasePlan": {
"name": "string",
"product": "string",
"publisher": "string"
},
"recommended": {
"memory": {
"max": "int",
"min": "int"
},
"vCPUs": {
"max": "int",
"min": "int"
}
},
"releaseNoteUri": "string"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.Compute/galleries/images
| Name |
Description |
Value |
| apiVersion |
The api version |
'2026-03-03' |
| location |
The geo-location where the resource lives |
string (required) |
| name |
The resource name |
string (required) |
| properties |
Describes the properties of a gallery image definition. |
GalleryImageProperties |
| tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
| type |
The resource type |
'Microsoft.Compute/galleries/images' |
Disallowed
| Name |
Description |
Value |
| diskTypes |
A list of disk types. |
string[] |
GalleryImageFeature
| Name |
Description |
Value |
| name |
The name of the gallery image feature. |
string |
| startsAtVersion |
The minimum gallery image version which supports this feature. |
string |
| value |
The value of the gallery image feature. |
string |
GalleryImageIdentifier
| Name |
Description |
Value |
| offer |
The name of the gallery image definition offer. |
string (required) |
| publisher |
The name of the gallery image definition publisher. |
string (required) |
| sku |
The name of the gallery image definition SKU. |
string (required) |
GalleryImageProperties
| Name |
Description |
Value |
| allowUpdateImage |
Optional. Must be set to true if the gallery image features are being updated. |
bool |
| architecture |
The architecture of the image. Applicable to OS disks only. |
'Arm64' 'x64' |
| description |
The description of this gallery image definition resource. This property is updatable. |
string |
| disallowed |
Describes the disallowed disk types. |
Disallowed |
| endOfLifeDate |
The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. |
string |
| eula |
The Eula agreement for the gallery image definition. |
string |
| features |
A list of gallery image features. |
GalleryImageFeature[] |
| hyperVGeneration |
The hypervisor generation of the Virtual Machine. Applicable to OS disks only. |
'V1' 'V2' |
| identifier |
This is the gallery image definition identifier. |
GalleryImageIdentifier (required) |
| osState |
This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. |
'Generalized' 'Specialized' (required) |
| 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. |
'Linux' 'Windows' (required) |
| privacyStatementUri |
The privacy statement uri. |
string |
| purchasePlan |
Describes the gallery image definition purchase plan. This is used by marketplace images. |
ImagePurchasePlan |
| recommended |
The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. |
RecommendedMachineConfiguration |
| releaseNoteUri |
The release note uri. |
string |
ImagePurchasePlan
| Name |
Description |
Value |
| name |
The plan ID. |
string |
| product |
The product ID. |
string |
| publisher |
The publisher ID. |
string |
RecommendedMachineConfiguration
ResourceRange
| Name |
Description |
Value |
| max |
The maximum number of the resource. |
int |
| min |
The minimum number of the resource. |
int |
The galleries/images resource type can be deployed with operations that target:
- Resource groups
For a list of changed properties in each API version, see change log.
Usage Examples
A basic example of deploying Shared Image within a Shared Image Gallery.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "gallery" {
type = "Microsoft.Compute/galleries@2022-03-03"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
description = ""
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "image" {
type = "Microsoft.Compute/galleries/images@2022-03-03"
parent_id = azapi_resource.gallery.id
name = var.resource_name
location = var.location
body = {
properties = {
architecture = "x64"
description = ""
disallowed = {
diskTypes = [
]
}
features = null
hyperVGeneration = "V1"
identifier = {
offer = "AccTesOffer230630032848825313"
publisher = "AccTesPublisher230630032848825313"
sku = "AccTesSku230630032848825313"
}
osState = "Generalized"
osType = "Linux"
privacyStatementUri = ""
recommended = {
memory = {
}
vCPUs = {
}
}
releaseNoteUri = ""
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
To create a Microsoft.Compute/galleries/images resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Compute/galleries/images@2026-03-03"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
allowUpdateImage = bool
architecture = "string"
description = "string"
disallowed = {
diskTypes = [
"string"
]
}
endOfLifeDate = "string"
eula = "string"
features = [
{
name = "string"
startsAtVersion = "string"
value = "string"
}
]
hyperVGeneration = "string"
identifier = {
offer = "string"
publisher = "string"
sku = "string"
}
osState = "string"
osType = "string"
privacyStatementUri = "string"
purchasePlan = {
name = "string"
product = "string"
publisher = "string"
}
recommended = {
memory = {
max = int
min = int
}
vCPUs = {
max = int
min = int
}
}
releaseNoteUri = "string"
}
}
}
Property Values
Microsoft.Compute/galleries/images
| Name |
Description |
Value |
| location |
The geo-location where the resource lives |
string (required) |
| name |
The resource name |
string (required) |
| parent_id |
The ID of the resource that is the parent for this resource. |
ID for resource of type: galleries |
| properties |
Describes the properties of a gallery image definition. |
GalleryImageProperties |
| tags |
Resource tags |
Dictionary of tag names and values. |
| type |
The resource type |
"Microsoft.Compute/galleries/images@2026-03-03" |
Disallowed
| Name |
Description |
Value |
| diskTypes |
A list of disk types. |
string[] |
GalleryImageFeature
| Name |
Description |
Value |
| name |
The name of the gallery image feature. |
string |
| startsAtVersion |
The minimum gallery image version which supports this feature. |
string |
| value |
The value of the gallery image feature. |
string |
GalleryImageIdentifier
| Name |
Description |
Value |
| offer |
The name of the gallery image definition offer. |
string (required) |
| publisher |
The name of the gallery image definition publisher. |
string (required) |
| sku |
The name of the gallery image definition SKU. |
string (required) |
GalleryImageProperties
| Name |
Description |
Value |
| allowUpdateImage |
Optional. Must be set to true if the gallery image features are being updated. |
bool |
| architecture |
The architecture of the image. Applicable to OS disks only. |
'Arm64' 'x64' |
| description |
The description of this gallery image definition resource. This property is updatable. |
string |
| disallowed |
Describes the disallowed disk types. |
Disallowed |
| endOfLifeDate |
The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. |
string |
| eula |
The Eula agreement for the gallery image definition. |
string |
| features |
A list of gallery image features. |
GalleryImageFeature[] |
| hyperVGeneration |
The hypervisor generation of the Virtual Machine. Applicable to OS disks only. |
'V1' 'V2' |
| identifier |
This is the gallery image definition identifier. |
GalleryImageIdentifier (required) |
| osState |
This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. |
'Generalized' 'Specialized' (required) |
| 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. |
'Linux' 'Windows' (required) |
| privacyStatementUri |
The privacy statement uri. |
string |
| purchasePlan |
Describes the gallery image definition purchase plan. This is used by marketplace images. |
ImagePurchasePlan |
| recommended |
The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. |
RecommendedMachineConfiguration |
| releaseNoteUri |
The release note uri. |
string |
ImagePurchasePlan
| Name |
Description |
Value |
| name |
The plan ID. |
string |
| product |
The product ID. |
string |
| publisher |
The publisher ID. |
string |
RecommendedMachineConfiguration
ResourceRange
| Name |
Description |
Value |
| max |
The maximum number of the resource. |
int |
| min |
The minimum number of the resource. |
int |