Microsoft.Compute disks template reference

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": "2018-09-30",
  "location": "string",
  "tags": {},
  "sku": {
    "name": "string"
  },
  "zones": [
    "string"
  ],
  "properties": {
    "osType": "string",
    "hyperVGeneration": "string",
    "creationData": {
      "createOption": "string",
      "storageAccountId": "string",
      "imageReference": {
        "id": "string",
        "lun": "integer"
      },
      "sourceUri": "string",
      "sourceResourceId": "string"
    },
    "diskSizeGB": "integer",
    "encryptionSettingsCollection": {
      "enabled": boolean,
      "encryptionSettings": [
        {
          "diskEncryptionKey": {
            "sourceVault": {
              "id": "string"
            },
            "secretUrl": "string"
          },
          "keyEncryptionKey": {
            "sourceVault": {
              "id": "string"
            },
            "keyUrl": "string"
          }
        }
      ]
    },
    "diskIOPSReadWrite": "integer",
    "diskMBpsReadWrite": "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 2018-09-30
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 VHD 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.

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 If createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription
imageReference object No Disk source information. - 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.

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

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

See all Microsoft.Compute templates in Azure Quickstart templates.