For system, network and cloud administrators

How to create an Azure managed disk using Azure PowerShell

In order to create a managed disk, you’ll first need a configuration for that disk. In the following example, we’re creating a new variable called diskConfig which holds the commands for creating that initial disk configuration. After that being declared, the New-AzDisk command will actually create the disk. In PowerShell session type:

$diskConfig = New-AzDiskConfig `
-Location westeurope `
-CreateOption Empty `
-DiskSizeGB 32 `
-Sku Standard_LRS`

New-AzDisk `
-ResourceGroupName yourresourcegroup `
-DiskName yourdiskname `
-Disk $diskConfig