Microsoft.Compute disks 2017-03-30

Bicep resource definition

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

To learn about resource group deployments, see Bicep.

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

Resource format

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

resource symbolicname 'Microsoft.Compute/disks@2017-03-30' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  sku: {
    name: 'string'
  }
  properties: {
    creationData: {
      createOption: 'string'
      imageReference: {
        id: 'string'
        lun: int
      }
      sourceResourceId: 'string'
      sourceUri: 'string'
      storageAccountId: 'string'
    }
    diskSizeGB: int
    encryptionSettings: {
      diskEncryptionKey: {
        secretUrl: 'string'
        sourceVault: {
          id: 'string'
        }
      }
      enabled: bool
      keyEncryptionKey: {
        keyUrl: 'string'
        sourceVault: {
          id: 'string'
        }
      }
    }
    osType: 'string'
  }
  zones: [
    'string'
  ]
}

Property values

disks

Name Description Value
name The resource name string (required)

Character limit: 1-80

Valid characters:
Alphanumerics, underscores, and hyphens.
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
sku The disks and snapshots sku name. Can be Standard_LRS or Premium_LRS. DiskSku
properties Disk resource properties. DiskProperties
zones The Logical zone list for Disk. string[]

DiskProperties

Name Description Value
creationData Disk source information. CreationData information cannot be changed after the disk has been created. CreationData (required)
diskSizeGB 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. int
encryptionSettings Encryption settings for disk or snapshot EncryptionSettings
osType The Operating System type. 'Linux'
'Windows'

CreationData

Name Description Value
createOption This enumerates the possible sources of a disk's creation. 'Attach'
'Copy'
'Empty'
'FromImage'
'Import' (required)
imageReference Disk source information. ImageDiskReference
sourceResourceId If createOption is Copy, this is the ARM id of the source snapshot or disk. string
sourceUri If createOption is Import, this is the URI of a blob to be imported into a managed disk. string
storageAccountId 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 string

ImageDiskReference

Name Description Value
id A relative uri containing either a Platform Image Repository or user image reference. string (required)
lun 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. int

EncryptionSettings

Name Description Value
diskEncryptionKey Key Vault Secret Url and vault id of the disk encryption key KeyVaultAndSecretReference
enabled 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. bool
keyEncryptionKey Key Vault Key Url and vault id of the key encryption key KeyVaultAndKeyReference

KeyVaultAndSecretReference

Name Description Value
secretUrl Url pointing to a key or secret in KeyVault string (required)
sourceVault Resource id of the KeyVault containing the key or secret SourceVault (required)

SourceVault

Name Description Value
id Resource Id string

KeyVaultAndKeyReference

Name Description Value
keyUrl Url pointing to a key or secret in KeyVault string (required)
sourceVault Resource id of the KeyVault containing the key or secret SourceVault (required)

DiskSku

Name Description Value
name The sku name. 'Premium_LRS'
'Standard_LRS'

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
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
Creates an ultra managed disk with a specific sector size.

Deploy to Azure
This template creates a new ultra managed disk allowing the user to specify a sector size of either 512 or 4096.
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
Windows Server VM with SSH

Deploy to Azure
Deploy a single Windows VM with Open SSH enabled so that you can connect through SSH using key-based authentication.
Create Disk & enable protection via Backup Vault

Deploy to Azure
Template that creates a disk and enables protection via Backup Vault
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

ARM template resource definition

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

To learn about resource group deployments, see ARM template.

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

Resource format

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

{
  "type": "Microsoft.Compute/disks",
  "apiVersion": "2017-03-30",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "sku": {
    "name": "string"
  },
  "properties": {
    "creationData": {
      "createOption": "string",
      "imageReference": {
        "id": "string",
        "lun": "int"
      },
      "sourceResourceId": "string",
      "sourceUri": "string",
      "storageAccountId": "string"
    },
    "diskSizeGB": "int",
    "encryptionSettings": {
      "diskEncryptionKey": {
        "secretUrl": "string",
        "sourceVault": {
          "id": "string"
        }
      },
      "enabled": "bool",
      "keyEncryptionKey": {
        "keyUrl": "string",
        "sourceVault": {
          "id": "string"
        }
      }
    },
    "osType": "string"
  },
  "zones": [ "string" ]
}

Property values

disks

Name Description Value
type The resource type 'Microsoft.Compute/disks'
apiVersion The resource api version '2017-03-30'
name The resource name string (required)

Character limit: 1-80

Valid characters:
Alphanumerics, underscores, and hyphens.
location Resource location string (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
sku The disks and snapshots sku name. Can be Standard_LRS or Premium_LRS. DiskSku
properties Disk resource properties. DiskProperties
zones The Logical zone list for Disk. string[]

DiskProperties

Name Description Value
creationData Disk source information. CreationData information cannot be changed after the disk has been created. CreationData (required)
diskSizeGB 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. int
encryptionSettings Encryption settings for disk or snapshot EncryptionSettings
osType The Operating System type. 'Linux'
'Windows'

CreationData

Name Description Value
createOption This enumerates the possible sources of a disk's creation. 'Attach'
'Copy'
'Empty'
'FromImage'
'Import' (required)
imageReference Disk source information. ImageDiskReference
sourceResourceId If createOption is Copy, this is the ARM id of the source snapshot or disk. string
sourceUri If createOption is Import, this is the URI of a blob to be imported into a managed disk. string
storageAccountId 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 string

ImageDiskReference

Name Description Value
id A relative uri containing either a Platform Image Repository or user image reference. string (required)
lun 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. int

EncryptionSettings

Name Description Value
diskEncryptionKey Key Vault Secret Url and vault id of the disk encryption key KeyVaultAndSecretReference
enabled 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. bool
keyEncryptionKey Key Vault Key Url and vault id of the key encryption key KeyVaultAndKeyReference

KeyVaultAndSecretReference

Name Description Value
secretUrl Url pointing to a key or secret in KeyVault string (required)
sourceVault Resource id of the KeyVault containing the key or secret SourceVault (required)

SourceVault

Name Description Value
id Resource Id string

KeyVaultAndKeyReference

Name Description Value
keyUrl Url pointing to a key or secret in KeyVault string (required)
sourceVault Resource id of the KeyVault containing the key or secret SourceVault (required)

DiskSku

Name Description Value
name The sku name. 'Premium_LRS'
'Standard_LRS'

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
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
Creates an ultra managed disk with a specific sector size.

Deploy to Azure
This template creates a new ultra managed disk allowing the user to specify a sector size of either 512 or 4096.
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
Windows Server VM with SSH

Deploy to Azure
Deploy a single Windows VM with Open SSH enabled so that you can connect through SSH using key-based authentication.
Create Disk & enable protection via Backup Vault

Deploy to Azure
Template that creates a disk and enables protection via Backup Vault
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

Terraform (AzAPI provider) resource definition

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

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

Resource format

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

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Compute/disks@2017-03-30"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      creationData = {
        createOption = "string"
        imageReference = {
          id = "string"
          lun = int
        }
        sourceResourceId = "string"
        sourceUri = "string"
        storageAccountId = "string"
      }
      diskSizeGB = int
      encryptionSettings = {
        diskEncryptionKey = {
          secretUrl = "string"
          sourceVault = {
            id = "string"
          }
        }
        enabled = bool
        keyEncryptionKey = {
          keyUrl = "string"
          sourceVault = {
            id = "string"
          }
        }
      }
      osType = "string"
    }
    zones = [
      "string"
    ]
    sku = {
      name = "string"
    }
  })
}

Property values

disks

Name Description Value
type The resource type "Microsoft.Compute/disks@2017-03-30"
name The resource name string (required)

Character limit: 1-80

Valid characters:
Alphanumerics, underscores, and hyphens.
location Resource location string (required)
parent_id To deploy to a resource group, use the ID of that resource group. string (required)
tags Resource tags Dictionary of tag names and values.
sku The disks and snapshots sku name. Can be Standard_LRS or Premium_LRS. DiskSku
properties Disk resource properties. DiskProperties
zones The Logical zone list for Disk. string[]

DiskProperties

Name Description Value
creationData Disk source information. CreationData information cannot be changed after the disk has been created. CreationData (required)
diskSizeGB 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. int
encryptionSettings Encryption settings for disk or snapshot EncryptionSettings
osType The Operating System type. "Linux"
"Windows"

CreationData

Name Description Value
createOption This enumerates the possible sources of a disk's creation. "Attach"
"Copy"
"Empty"
"FromImage"
"Import" (required)
imageReference Disk source information. ImageDiskReference
sourceResourceId If createOption is Copy, this is the ARM id of the source snapshot or disk. string
sourceUri If createOption is Import, this is the URI of a blob to be imported into a managed disk. string
storageAccountId 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 string

ImageDiskReference

Name Description Value
id A relative uri containing either a Platform Image Repository or user image reference. string (required)
lun 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. int

EncryptionSettings

Name Description Value
diskEncryptionKey Key Vault Secret Url and vault id of the disk encryption key KeyVaultAndSecretReference
enabled 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. bool
keyEncryptionKey Key Vault Key Url and vault id of the key encryption key KeyVaultAndKeyReference

KeyVaultAndSecretReference

Name Description Value
secretUrl Url pointing to a key or secret in KeyVault string (required)
sourceVault Resource id of the KeyVault containing the key or secret SourceVault (required)

SourceVault

Name Description Value
id Resource Id string

KeyVaultAndKeyReference

Name Description Value
keyUrl Url pointing to a key or secret in KeyVault string (required)
sourceVault Resource id of the KeyVault containing the key or secret SourceVault (required)

DiskSku

Name Description Value
name The sku name. "Premium_LRS"
"Standard_LRS"