Disk Types by Role
Every Azure VM can have three categories of disks:
OS Disk
Every VM has exactly one OS disk. This is where the operating system is installed — Windows or Linux. It's created from the image you selected when creating the VM.
- Registered as drive C: on Windows, /dev/sda on Linux
- Default size: 127 GB (Windows) or 30 GB (Linux)
- Billed even when the VM is deallocated
- Can be resized, but requires deallocating the VM first
Data Disks
Optional additional disks for storing application data, databases, logs, etc. Best practice is to keep application data separate from the OS disk.
- Registered as drive D:, E: etc on Windows, /dev/sdc, /dev/sdd etc on Linux
- Can have multiple data disks per VM (limit depends on VM size)
- Can be detached and reattached to different VMs
- Can be up to 32 TB per disk
Temporary Disk
A local disk that comes with most VM sizes — it's physically on the host machine, not network-attached. This makes it much faster than managed disks, but it's ephemeral — data is lost when the VM is deallocated, restarted, or resized.
- Drive D: on Windows, /dev/sdb on Linux (mounted at /mnt)
- Used for temporary data, swap files, scratch space
- Never store persistent data here — it will be lost
- Not all VM sizes include a temp disk (look for "d" in the VM name, e.g., D4ds_v5)
Disk Storage Types
Azure offers four disk storage tiers, from highest performance to lowest cost:
| Disk Type | Max IOPS | Max Throughput | Use Case | Cost |
|---|---|---|---|---|
| Ultra Disk | Up to 160,000 | Up to 4,000 MB/s | Highest-performance databases, SAP HANA | Highest |
| Premium SSD v2 | Up to 80,000 | Up to 1,200 MB/s | Production databases, I/O intensive apps | High |
| Premium SSD | Up to 20,000 | Up to 900 MB/s | Production workloads, required for 99.9% SLA | Medium-High |
| Standard SSD | Up to 6,000 | Up to 750 MB/s | Dev/test, light production, web servers | Medium |
| Standard HDD | Up to 2,000 | Up to 500 MB/s | Backups, archives, infrequent access | Lowest |
IOPS and Throughput Explained
Disk performance is measured by two metrics — understanding them helps you choose the right disk:
IOPS (Input/Output Operations Per Second)
How many read/write operations the disk can handle per second. Matters most for workloads with many small, random reads and writes — like databases (SQL Server, PostgreSQL, MySQL).
Example: A database doing many small transaction reads/writes needs high IOPS. An application reading one large file sequentially needs high throughput, not necessarily high IOPS.
Throughput (MB/s)
How much data the disk can transfer per second. Matters most for workloads moving large sequential data — like video processing, backups, data warehousing, or big file copies.
Video / bulk data workload → prioritise throughput → Premium SSD v2 or Ultra Disk
Dev/test or web server → Standard SSD is usually sufficient
Disk Limits per VM
The number of data disks you can attach to a VM depends on the VM size. Here are examples:
| VM Size | Max Data Disks |
|---|---|
| Standard_B2s | 4 |
| Standard_D4s_v5 | 8 |
| Standard_D8s_v5 | 16 |
| Standard_D16s_v5 | 32 |
| Standard_D32s_v5 | 32 |
| Standard_E32s_v5 | 32 |
Disk Caching
Azure allows you to configure caching on managed disks to improve performance. The cache stores frequently accessed data in the VM host's local memory:
| Cache Setting | Behaviour | Best For |
|---|---|---|
| Read/Write | Caches both reads and writes | OS disk (default for OS disk) |
| Read-only | Caches reads, writes go directly to disk | Data disks with lots of read operations |
| None | No caching | Write-heavy workloads, databases with their own caching |
Disk Encryption
Azure provides multiple levels of disk encryption:
- Azure Storage Service Encryption (SSE) — All managed disks are encrypted at rest by default using AES-256. This happens automatically with no configuration needed.
- Azure Disk Encryption (ADE) — Encrypts the OS and data disks inside the VM using BitLocker (Windows) or DM-Crypt (Linux). Keys stored in Azure Key Vault.
- Customer-Managed Keys (CMK) — Use your own encryption keys stored in Azure Key Vault instead of Microsoft-managed keys.
Adding and Detaching Disks
# Add a new 128 GB Premium SSD data disk
az vm disk attach \
--resource-group myResourceGroup \
--vm-name myVM \
--name myDataDisk \
--new \
--size-gb 128 \
--sku Premium_LRS
az vm disk detach \
--resource-group myResourceGroup \
--vm-name myVM \
--name myDataDisk
Choosing the Right Disk
| Scenario | Recommended Disk | Why |
|---|---|---|
| Production SQL Server database | Premium SSD | High IOPS, low latency, required for SLA |
| OS disk for production VM | Premium SSD | Required for 99.9% SLA |
| Dev/test environment | Standard SSD | Good balance of cost and performance |
| Backup/archive storage | Standard HDD | Lowest cost, performance not critical |
| SAP HANA or highest-perf DB | Ultra Disk | Extreme IOPS and throughput |
| Log files (sequential writes) | Premium SSD | Consistent performance for write-heavy logs |