Microsoft.Compute images 2018-04-01

Bicep resource definition

The images resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Compute/images resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Compute/images@2018-04-01' = {
  location: 'string'
  name: 'string'
  properties: {
    sourceVirtualMachine: {
      id: 'string'
    }
    storageProfile: {
      dataDisks: [
        {
          blobUri: 'string'
          caching: 'string'
          diskSizeGB: int
          lun: int
          managedDisk: {
            id: 'string'
          }
          snapshot: {
            id: 'string'
          }
          storageAccountType: 'string'
        }
      ]
      osDisk: {
        blobUri: 'string'
        caching: 'string'
        diskSizeGB: int
        managedDisk: {
          id: 'string'
        }
        osState: 'string'
        osType: 'string'
        snapshot: {
          id: 'string'
        }
        storageAccountType: 'string'
      }
      zoneResilient: bool
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

Property values

ImageDataDisk

Name Description Value
blobUri The Virtual Hard Disk. string
caching Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage
'None'
'ReadOnly'
'ReadWrite'
diskSizeGB Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB
int
lun Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. int (required)
managedDisk The managedDisk. SubResource
snapshot The snapshot. SubResource
storageAccountType Specifies the storage account type for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'

ImageOSDisk

Name Description Value
blobUri The Virtual Hard Disk. string
caching Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage
'None'
'ReadOnly'
'ReadWrite'
diskSizeGB Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB
int
managedDisk The managedDisk. SubResource
osState The OS State. 'Generalized'
'Specialized' (required)
osType This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

Possible values are:

Windows

Linux
'Linux'
'Windows' (required)
snapshot The snapshot. SubResource
storageAccountType Specifies the storage account type for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'

ImageProperties

Name Description Value
sourceVirtualMachine The source virtual machine from which Image is created. SubResource
storageProfile Specifies the storage settings for the virtual machine disks. ImageStorageProfile

ImageStorageProfile

Name Description Value
dataDisks Specifies the parameters that are used to add a data disk to a virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.
ImageDataDisk[]
osDisk Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.
ImageOSDisk
zoneResilient Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). bool

Microsoft.Compute/images

Name Description Value
location Resource location string (required)
name The resource name string (required)
properties Describes the properties of an Image. ImageProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates

ResourceTags

Name Description Value

SubResource

Name Description Value
id Resource Id string

ARM template resource definition

The images resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Compute/images resource, add the following JSON to your template.

{
  "type": "Microsoft.Compute/images",
  "apiVersion": "2018-04-01",
  "name": "string",
  "location": "string",
  "properties": {
    "sourceVirtualMachine": {
      "id": "string"
    },
    "storageProfile": {
      "dataDisks": [
        {
          "blobUri": "string",
          "caching": "string",
          "diskSizeGB": "int",
          "lun": "int",
          "managedDisk": {
            "id": "string"
          },
          "snapshot": {
            "id": "string"
          },
          "storageAccountType": "string"
        }
      ],
      "osDisk": {
        "blobUri": "string",
        "caching": "string",
        "diskSizeGB": "int",
        "managedDisk": {
          "id": "string"
        },
        "osState": "string",
        "osType": "string",
        "snapshot": {
          "id": "string"
        },
        "storageAccountType": "string"
      },
      "zoneResilient": "bool"
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property values

ImageDataDisk

Name Description Value
blobUri The Virtual Hard Disk. string
caching Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage
'None'
'ReadOnly'
'ReadWrite'
diskSizeGB Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB
int
lun Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. int (required)
managedDisk The managedDisk. SubResource
snapshot The snapshot. SubResource
storageAccountType Specifies the storage account type for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'

ImageOSDisk

Name Description Value
blobUri The Virtual Hard Disk. string
caching Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage
'None'
'ReadOnly'
'ReadWrite'
diskSizeGB Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB
int
managedDisk The managedDisk. SubResource
osState The OS State. 'Generalized'
'Specialized' (required)
osType This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

Possible values are:

Windows

Linux
'Linux'
'Windows' (required)
snapshot The snapshot. SubResource
storageAccountType Specifies the storage account type for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'

ImageProperties

Name Description Value
sourceVirtualMachine The source virtual machine from which Image is created. SubResource
storageProfile Specifies the storage settings for the virtual machine disks. ImageStorageProfile

ImageStorageProfile

Name Description Value
dataDisks Specifies the parameters that are used to add a data disk to a virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.
ImageDataDisk[]
osDisk Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.
ImageOSDisk
zoneResilient Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). bool

Microsoft.Compute/images

Name Description Value
apiVersion The api version '2018-04-01'
location Resource location string (required)
name The resource name string (required)
properties Describes the properties of an Image. ImageProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.Compute/images'

ResourceTags

Name Description Value

SubResource

Name Description Value
id Resource Id string

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Create a VM from User Image

Deploy to Azure
This template allows you to create a Virtual Machines from a User image. This template also deploys a Virtual Network, Public IP addresses and a Network Interface.
Create a VM in a new or existing vnet from a generalized VHD

Deploy to Azure
This template creates a VM from a generalized VHD and let you connect it to a new or existing VNET that can reside in another Resource Group than the virtual machine
Deploy a VM Scale Set with a Linux custom image

Deploy to Azure
This template allows you to deploy a custom VM Linux image inside an Scale Set. These VMs are behind a load balancer with HTTP load balancing (by default on port 80). The example uses a custom script to do the application deployment and update, you may have to provide your custom script for your own update procedure. You will have to provide a generalized image of your VM in the same subscription and region where you create the VMSS.
Deploy a VM Scale Set with a Windows custom image

Deploy to Azure
This template allows you to deploy a simple VM Scale Set usng a custom Windows image. These VMs are behind a load balancer with HTTP load balancing (by default on port 80)

Terraform (AzAPI provider) resource definition

The 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.

Resource format

To create a Microsoft.Compute/images resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Compute/images@2018-04-01"
  name = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      sourceVirtualMachine = {
        id = "string"
      }
      storageProfile = {
        dataDisks = [
          {
            blobUri = "string"
            caching = "string"
            diskSizeGB = int
            lun = int
            managedDisk = {
              id = "string"
            }
            snapshot = {
              id = "string"
            }
            storageAccountType = "string"
          }
        ]
        osDisk = {
          blobUri = "string"
          caching = "string"
          diskSizeGB = int
          managedDisk = {
            id = "string"
          }
          osState = "string"
          osType = "string"
          snapshot = {
            id = "string"
          }
          storageAccountType = "string"
        }
        zoneResilient = bool
      }
    }
  })
}

Property values

ImageDataDisk

Name Description Value
blobUri The Virtual Hard Disk. string
caching Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage
'None'
'ReadOnly'
'ReadWrite'
diskSizeGB Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB
int
lun Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. int (required)
managedDisk The managedDisk. SubResource
snapshot The snapshot. SubResource
storageAccountType Specifies the storage account type for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'

ImageOSDisk

Name Description Value
blobUri The Virtual Hard Disk. string
caching Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage
'None'
'ReadOnly'
'ReadWrite'
diskSizeGB Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB
int
managedDisk The managedDisk. SubResource
osState The OS State. 'Generalized'
'Specialized' (required)
osType This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

Possible values are:

Windows

Linux
'Linux'
'Windows' (required)
snapshot The snapshot. SubResource
storageAccountType Specifies the storage account type for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'

ImageProperties

Name Description Value
sourceVirtualMachine The source virtual machine from which Image is created. SubResource
storageProfile Specifies the storage settings for the virtual machine disks. ImageStorageProfile

ImageStorageProfile

Name Description Value
dataDisks Specifies the parameters that are used to add a data disk to a virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.
ImageDataDisk[]
osDisk Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.
ImageOSDisk
zoneResilient Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). bool

Microsoft.Compute/images

Name Description Value
location Resource location string (required)
name The resource name string (required)
properties Describes the properties of an Image. ImageProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.Compute/images@2018-04-01"

ResourceTags

Name Description Value

SubResource

Name Description Value
id Resource Id string