Microsoft.Compute disks 2019-11-01

Template format

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

{
  "name": "string",
  "type": "Microsoft.Compute/disks",
  "apiVersion": "2019-11-01",
  "location": "string",
  "tags": {},
  "sku": {
    "name": "string"
  },
  "zones": [
    "string"
  ],
  "properties": {
    "osType": "string",
    "hyperVGeneration": "string",
    "creationData": {
      "createOption": "string",
      "storageAccountId": "string",
      "imageReference": {
        "id": "string",
        "lun": "integer"
      },
      "galleryImageReference": {
        "id": "string",
        "lun": "integer"
      },
      "sourceUri": "string",
      "sourceResourceId": "string",
      "uploadSizeBytes": "integer"
    },
    "diskSizeGB": "integer",
    "encryptionSettingsCollection": {
      "enabled": "boolean",
      "encryptionSettings": [
        {
          "diskEncryptionKey": {
            "sourceVault": {
              "id": "string"
            },
            "secretUrl": "string"
          },
          "keyEncryptionKey": {
            "sourceVault": {
              "id": "string"
            },
            "keyUrl": "string"
          }
        }
      ],
      "encryptionSettingsVersion": "string"
    },
    "diskIOPSReadWrite": "integer",
    "diskMBpsReadWrite": "integer",
    "diskIOPSReadOnly": "integer",
    "diskMBpsReadOnly": "integer",
    "encryption": {
      "diskEncryptionSetId": "string",
      "type": "string"
    },
    "maxShares": "integer"
  }
}

Property values

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

Microsoft.Compute/disks object

Name Type Required Value
name string Yes The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
type enum Yes Microsoft.Compute/disks
apiVersion enum Yes 2019-11-01
location string Yes Resource location
tags object No Resource tags
sku object No DiskSku object
zones array No The Logical zone list for Disk. - string
properties object Yes DiskProperties object

DiskSku object

Name Type Required Value
name enum No The sku name. - Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS

DiskProperties object

Name Type Required Value
osType enum No The Operating System type. - Windows or Linux
hyperVGeneration enum No The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - V1 or V2
creationData object Yes Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData object
diskSizeGB integer No If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
encryptionSettingsCollection object No Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection object
diskIOPSReadWrite integer No The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes.
diskMBpsReadWrite integer No The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10.
diskIOPSReadOnly integer No The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes.
diskMBpsReadOnly integer No The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10.
encryption object No Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption object
maxShares integer No The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.

CreationData object

Name Type Required Value
createOption enum Yes This enumerates the possible sources of a disk's creation. - Empty, Attach, FromImage, Import, Copy, Restore, Upload
storageAccountId string No Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk.
imageReference object No Disk source information. - ImageDiskReference object
galleryImageReference object No Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. - ImageDiskReference object
sourceUri string No If createOption is Import, this is the URI of a blob to be imported into a managed disk.
sourceResourceId string No If createOption is Copy, this is the ARM id of the source snapshot or disk.
uploadSizeBytes integer No If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer).

EncryptionSettingsCollection object

Name Type Required Value
enabled boolean Yes Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged.
encryptionSettings array No A collection of encryption settings, one for each disk volume. - EncryptionSettingsElement object
encryptionSettingsVersion string No Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption.

Encryption object

Name Type Required Value
diskEncryptionSetId string No ResourceId of the disk encryption set to use for enabling encryption at rest.
type enum No The type of key used to encrypt the data of the disk. - EncryptionAtRestWithPlatformKey or EncryptionAtRestWithCustomerKey

ImageDiskReference object

Name Type Required Value
id string Yes A relative uri containing either a Platform Image Repository or user image reference.
lun integer No If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null.

EncryptionSettingsElement object

Name Type Required Value
diskEncryptionKey object No Key Vault Secret Url and vault id of the disk encryption key - KeyVaultAndSecretReference object
keyEncryptionKey object No Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. - KeyVaultAndKeyReference object

KeyVaultAndSecretReference object

Name Type Required Value
sourceVault object Yes Resource id of the KeyVault containing the key or secret - SourceVault object
secretUrl string Yes Url pointing to a key or secret in KeyVault

KeyVaultAndKeyReference object

Name Type Required Value
sourceVault object Yes Resource id of the KeyVault containing the key or secret - SourceVault object
keyUrl string Yes Url pointing to a key or secret in KeyVault

SourceVault object

Name Type Required Value
id string No Resource Id

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
SQL VM Performance Optimized Storage Settings on UltraSSD

Deploy to Azure
Create a SQL Server Virtual Machine with performance optimized storage settings, using UltraSSD for SQL Log files
Create a VM from a EfficientIP VHD

Deploy to Azure
This template creates a VM from a EfficientIP VHD and let you connect it to an existing VNET that can reside in another Resource Group then the virtual machine
Create VM from existing VHDs and connect it to existingVNET

Deploy to Azure
This template creates a VM from VHDs (OS + data disk) and let you connect it to an existing VNET that can reside in another Resource Group then the virtual machine
Create a VM in a new or existing vnet from a custom VHD

Deploy to Azure
This template creates a VM from a specialized 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 3 node Percona XtraDB Cluster in Availability Zones

Deploy to Azure
This template deploys a 3 node MySQL high availability cluster on CentOS 6.5 or Ubuntu 12.04