Microsoft.Compute images 2019-03-01

The images resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

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

resource symbolicname 'Microsoft.Compute/images@2019-03-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    hyperVGeneration: 'string'
    sourceVirtualMachine: {
      id: 'string'
    }
    storageProfile: {
      dataDisks: [
        {
          blobUri: 'string'
          diskSizeGB: int
          lun: int
          managedDisk: {
            id: 'string'
          }
          snapshot: {
            id: 'string'
          }
          storageAccountType: 'string'
        }
      ]
      osDisk: {
        blobUri: 'string'
        diskSizeGB: int
        managedDisk: {
          id: 'string'
        }
        osState: 'string'
        osType: 'string'
        snapshot: {
          id: 'string'
        }
        storageAccountType: 'string'
      }
      zoneResilient: bool
    }
  }
}

Property values

images

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.Compute/images'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2019-03-01'
name The resource name string (required)
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
properties Describes the properties of an Image. ImageProperties

ImageProperties

Name Description Value
hyperVGeneration Specifies the HyperVGeneration Type 'V1'
'V2'
sourceVirtualMachine SubResource
storageProfile Describes a storage profile. ImageStorageProfile

SubResource

Name Description Value
id Resource Id string

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 Describes an Operating System disk. 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

ImageDataDisk

Name Description Value
blobUri The Virtual Hard Disk. string
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 SubResource
snapshot SubResource
storageAccountType 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 uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. For more information regarding disks supported for Windows Virtual Machines, refer to /azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to /azure/virtual-machines/linux/disks-types 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'
'UltraSSD_LRS'

ImageOSDisk

Name Description Value
blobUri The Virtual Hard Disk. string
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 SubResource
osState The OS State. 'Generalized'
'Specialized'
osType The operating system of the osDiskImage. 'Linux'
'Windows'
snapshot SubResource
storageAccountType 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 uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. For more information regarding disks supported for Windows Virtual Machines, refer to /azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to /azure/virtual-machines/linux/disks-types 'Premium_LRS'
'StandardSSD_LRS'
'Standard_LRS'
'UltraSSD_LRS'

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)