Microsoft.Compute images 2019-12-01

Template format

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

{
  "name": "string",
  "type": "Microsoft.Compute/images",
  "apiVersion": "2019-12-01",
  "location": "string",
  "tags": {},
  "properties": {
    "sourceVirtualMachine": {
      "id": "string"
    },
    "storageProfile": {
      "osDisk": {
        "snapshot": {
          "id": "string"
        },
        "managedDisk": {
          "id": "string"
        },
        "blobUri": "string",
        "caching": "string",
        "diskSizeGB": "integer",
        "storageAccountType": "string",
        "diskEncryptionSet": {
          "id": "string"
        },
        "osType": "string",
        "osState": "string"
      },
      "dataDisks": [
        {
          "snapshot": {
            "id": "string"
          },
          "managedDisk": {
            "id": "string"
          },
          "blobUri": "string",
          "caching": "string",
          "diskSizeGB": "integer",
          "storageAccountType": "string",
          "diskEncryptionSet": {
            "id": "string"
          },
          "lun": "integer"
        }
      ],
      "zoneResilient": "boolean"
    },
    "hyperVGeneration": "string"
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Compute/images object

Name Type Required Value
name string Yes The name of the image.
type enum Yes Microsoft.Compute/images
apiVersion enum Yes 2019-12-01
location string Yes Resource location
tags object No Resource tags
properties object Yes ImageProperties object

ImageProperties object

Name Type Required Value
sourceVirtualMachine object No The source virtual machine from which Image is created. - SubResource object
storageProfile object No Specifies the storage settings for the virtual machine disks. - ImageStorageProfile object
hyperVGeneration enum No Gets the HyperVGenerationType of the VirtualMachine created from the image. - V1 or V2

SubResource object

Name Type Required Value
id string No Resource Id

ImageStorageProfile object

Name Type Required Value
osDisk object No 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 object
dataDisks array No 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 object
zoneResilient boolean No 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).

ImageOSDisk object

Name Type Required Value
snapshot object No The snapshot. - SubResource object
managedDisk object No The managedDisk. - SubResource object
blobUri string No The Virtual Hard Disk.
caching enum No Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage. - None, ReadOnly, ReadWrite
diskSizeGB integer No 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
storageAccountType enum No Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. - Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS
diskEncryptionSet object No Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSetParameters object
osType enum Yes 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. - Windows or Linux
osState enum Yes The OS State. - Generalized or Specialized

ImageDataDisk object

Name Type Required Value
snapshot object No The snapshot. - SubResource object
managedDisk object No The managedDisk. - SubResource object
blobUri string No The Virtual Hard Disk.
caching enum No Specifies the caching requirements.

Possible values are:

None

ReadOnly

ReadWrite

Default: None for Standard storage. ReadOnly for Premium storage. - None, ReadOnly, ReadWrite
diskSizeGB integer No 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
storageAccountType enum No Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. - Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS
diskEncryptionSet object No Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSetParameters object
lun integer Yes 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.

DiskEncryptionSetParameters object

Name Type Required Value
id string No Resource Id

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 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)