Azure VM temporary storage is the local disk on the physical host that runs your VM. It is fast and included in the VM price, but it isn't a managed disk, and Azure can wipe it whenever the VM stops, moves or gets redeployed. This guide is about the data you keep on that disk: what survives, what belongs there, how to set up the raw NVMe temp disks on v6 sizes, and when local scratch space beats a managed data disk. Running the OS itself on local storage is a separate feature, covered in our Azure ephemeral OS disks guide.
Key Takeaways
- Data on the temporary disk "might be lost during a maintenance event, when you redeploy a VM, or when you stop the VM." A standard restart keeps it (Microsoft Learn, managed disks overview).
- Keep only rebuildable data there: page files, swap, SQL Server tempdb, caches and scratch output. Never databases, logs or anything you can't recreate.
- v6 sizes with a "d" in the name ship raw, unformatted NVMe temp disks. You must initialize and format them after every deallocation or host move.
- As scratch space, a local disk can beat a managed disk. In East US (Linux, pay-as-you-go, Nov 2026), a D4ds_v6 adds $34.31 a month over a D4s_v6 for 220 GiB at 75,000 read IOPS. A 256 GiB P15 costs $38.01 a month for 1,100 IOPS.
What is Azure VM temporary storage?
Azure VM temporary storage is a local disk on the Azure host server that the VM can use for short-term data. Microsoft describes it as storage that "isn't a managed disk" and that is "intended for storing only data such as page files, swap files, or SQL Server tempdb files."
Where you find it depends on the OS and VM generation:
OS and data disks are managed disks: remote, replicated and billed separately (see our Azure managed disk guide). The temporary disk lives on the VM's host, so it has low latency and no per-GiB charge, but no replication, snapshots or backup.
On v5 and later sizes, Azure encrypts the temporary disk at rest automatically. On older sizes, the temp disk is encrypted only if you turn on encryption at host or set Azure Disk Encryption to cover all volumes.

When is data on the Azure temporary disk lost?
Data on the Azure temporary disk can be lost whenever the VM is deallocated or lands on a different host; a plain restart doesn't wipe it. Microsoft's wording: data "might be lost during a maintenance event, when you redeploy a VM, or when you stop the VM. During a successful standard restart of the VM, data on the temporary disk persists."
Source: Microsoft Learn managed disks overview, redeploy, resize and NVMe temp disk FAQ pages, Nov 2026.
Resize is the case teams forget. Microsoft's resize docs say changing the size of a running VM "will cause it to restart," and the D: drive guide says a resize or Stop (Deallocate) "may trigger placement of the virtual machine to a new hypervisor." On a new host, the temp disk comes back empty.
For NVMe temp disks, Microsoft spells out both outcomes: if the VM moves to new hardware, the drives unmount and new, unformatted disks appear. If it stays on the same hardware, the disks "might still be present." Your startup logic must handle both.
What is safe to store on an Azure VM temp disk?
Store only data the system or application can regenerate on its own; Azure VM temporary storage is a cache, not a home. Microsoft's VM and SQL Server docs name the same short list.
Safe on the temp disk:
- Windows page file (pagefile.sys) and Linux swap
- SQL Server tempdb data and log files
- SQL Server buffer pool extensions
- Application caches that rebuild on a miss (build caches, package caches, image thumbnails)
- Scratch and intermediate files for batch, render, ETL or compile jobs, as long as the job can restart from its input
Never on the temp disk:
- User database files and transaction logs
- Uploaded files, queues or session state that exist nowhere else
- Anything a backup policy is supposed to cover: per the Azure Backup support matrix, "Azure Backup doesn't back up temporary disks"
- Application installs or config that an image or script points to at a fixed path
Gotcha: if an app expects D: for its own data, Microsoft documents how to give the temp disk another letter and attach a managed data disk as D:. Azure then won't take D: back when the VM moves.

Which VM sizes include a local temp disk?
Sizes with a lowercase "d" in the name, such as Ddsv5 and Ddsv6, include Azure VM temporary storage. Sizes without it, such as Dsv5 and Dsv6, have none. Microsoft says the diskless Dv5 and Dsv5 series "provide a better value proposition for workloads that don't require local temp disk."
Source: Microsoft Learn size series pages for Dsv5, Ddsv5, Dsv6 and Ddsv6, retrieved Nov 2026. IOPS are best case (4 KiB blocks, QD=256); Microsoft notes steady-state write performance is lower.
Two rules matter before you switch families:
- Windows can't resize across the line. Windows VMs resize only disk to disk or diskless to diskless; Linux can cross. For Windows, move the pagefile to C:, snapshot, and build a new VM from the snapshot.
- Images may depend on D:. Microsoft warns that if a pagefile or swap file sits on the temp disk, or an image depends on the resource disk, the diskless sizes "won't work."
How are NVMe temp disks on v6 sizes different?
On v6 sizes, Azure VM temporary storage is faster NVMe, but Azure no longer formats it for you. Microsoft's FAQ says "all of the new v6 VMs with local disk support NVMe temp disks," while most v5 and earlier sizes use SCSI. Unlike earlier D and E series, "the new v6 VMs come with raw, unformatted NVMe disks."
What changes in practice:
- No automatic D: or /mnt. After a deallocation, planned maintenance or automatic recovery, the VM starts with "only raw temp NVMe disks" until you format them.
- Pagefile stays on C:. On v6, Windows places the pagefile on the OS disk unless you use an ephemeral OS disk. You can move it to the NVMe temp disk after boot.
- Multiple disks on bigger sizes. A D16ds_v6 has two 440 GiB disks with combined published IOPS. Stripe them to get the full figure.
- Ephemeral OS changes the layout. An ephemeral OS disk converts one or more NVMe disks into a slower SCSI-style disk (see our Azure ephemeral OS disks guide).
- Hardware encryption by default. v6 NVMe temp disks use hardware encryption with a platform-managed key, and the device locks at VM stop.
Microsoft's best practice: run the mounting script at every start and delay startup work that needs the drive until it finishes.

How do you check and format the temp disk?
Check the size, then the device inside the guest, then format only the disk you confirmed. In the SKU API, MaxResourceVolumeMB gives SCSI temp disk size and NVMeDiskSizeInMiB gives NVMe local storage.
# Does the size have local temp storage, and which kind?
az vm list-skus --location eastus --size Standard_D4ds_v6 --resource-type virtualMachines \
--query "[0].capabilities[?name=='MaxResourceVolumeMB' || name=='NVMeDiskSizeInMiB']" -o table
On Linux
# SCSI temp disk: Azure creates a stable symlink
ls -l /dev/disk/azure/resource*
# NVMe temp disk: list devices and confirm the model string
sudo nvme list # needs the nvme-cli package
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,MODEL
An NVMe temp disk shows the model "Microsoft NVMe Direct Disk" and no mount point. Format a single disk directly; for several, use the RAID 0 script in Microsoft's NVMe temp FAQ.
# Single NVMe temp disk. Confirm the device name first: this erases it.
sudo mkfs.xfs -f /dev/nvme0n1
sudo mkdir -p /mnt/nvme_temp
sudo mount /dev/nvme0n1 /mnt/nvme_temp
# Verify
findmnt /mnt/nvme_temp && df -h /mnt/nvme_temp
If you add an /etc/fstab entry, include nofail so the VM still boots when the device comes back raw. Microsoft's RAID script uses defaults,nofail.
On Windows
# Pool, stripe and format all raw NVMe temp disks (from Microsoft's FAQ; erases them)
$Raw = Get-PhysicalDisk -CanPool $True | Where-Object { $_.FriendlyName -like "*NVMe Direct Disk*" }
New-StoragePool -FriendlyName NVMePool -StorageSubsystemFriendlyName "Windows Storage*" `
-PhysicalDisks $Raw -ResiliencySettingNameDefault Simple
$Disk = New-VirtualDisk -FriendlyName NVMeTemporary -StoragePoolFriendlyName NVMePool `
-NumberOfColumns @($Raw).Count -PhysicalDiskRedundancy 0 -ResiliencySettingName Simple -UseMaximumSize
$Disk | Initialize-Disk
New-Partition -DiskId $Disk.UniqueId -AssignDriveLetter -UseMaximumSize | Format-Volume
# Verify
Get-Volume | Format-Table DriveLetter, FileSystemLabel, Size, SizeRemaining
Run the format block as a startup scheduled task. On v5 and older SCSI sizes, Windows presents the temp disk as D: on its own. On Linux SCSI sizes, check whether your image's provisioning agent already formats and mounts /dev/disk/azure/resource before you run mkfs on it.
Should SQL Server tempdb live on the temp disk?
Yes, for most standalone SQL Server VMs, tempdb is the classic use of Azure VM temporary storage. Microsoft's SQL Server on Azure VM storage guidance says to "place tempdb on the temporary disk ... for most SQL Server workloads that aren't part of a failover cluster instance." On SCSI D: drives, "the SQL IaaS Agent extension handles the folder and permissions needed upon re-provisioning," and portal deployments target tempdb to D: by default.
Details that catch people:
- Cache limits are shared. The VM cache and the temp drive use the same local SSD, so tempdb I/O counts against the VM's cached IOPS and throughput limits.
- Monitoring is limited. Azure Monitor has no disk-level metrics for D:. The VM Cached IOPS Consumed Percentage metric mixes temp drive and host cache traffic.
- Too small or missing? Resize to a larger temp drive, or put tempdb on its own data disk with read-only caching (see our Azure disk host caching guide).
- Failover cluster instances. Keep tempdb on shared storage. Local temp disk is an advanced option that needs custom monitoring, because a failed local drive won't trigger failover.
On v6 NVMe sizes the drive can come back raw, and SQL Server won't start if the tempdb folder is missing. A common pattern: set the SQL Server service to manual and have the startup script format the disk, create the folder, then start the service. [VERIFY: whether the SQL IaaS Agent extension now handles NVMe temp disk formatting on v6 sizes; the Microsoft storage best practices page doesn't say.]

What does a local temp disk cost?
The local disk isn't billed as storage; it shows up in the hourly VM rate. Comparing a "d" size with its diskless twin prices the temp disk. Prices below are Linux, pay-as-you-go, East US, from the Azure Retail Prices API in Nov 2026, using 730 hours a month.
The arithmetic:
- v5: $0.226 minus $0.192 = $0.034 an hour. $0.034 x 730 = $24.82 a month, or $297.84 a year per VM.
- v6: $0.249 minus $0.202 = $0.047 an hour. $0.047 x 730 = $34.31 a month, or $411.72 a year per VM.
Worked example: scratch space for a build server
Say a Linux build agent needs about 120 GiB of scratch space that it can rebuild from source control. You can buy that two ways in East US:
- Diskless size plus a Premium SSD: D4s_v5 at $140.16 plus a P10 (128 GiB, 500 IOPS, 100 MB/s) at $19.71 = $159.87 a month.
- Size with a temp disk: D4ds_v5 at $164.98 a month for 150 GiB rated at 19,000 read IOPS and 250 MBps.
The temp disk route costs $5.11 more a month ($164.98 minus $159.87) but gives about 38 times the read IOPS of the P10 (19,000 / 500). Need 256 GiB? A P15 at $38.01 makes the diskless option $178.17 a month, so the D4ds_v5 is $13.19 cheaper, but only holds 150 GiB. On v6, the D4ds_v6 premium of $34.31 buys 220 GiB at 75,000 read IOPS, compared with $38.01 for a 256 GiB P15 at 1,100 IOPS.
If you already pay for a "d" size, use its temp disk for scratch, cache and tempdb before you buy a managed disk for that work. If the temp disk sits empty, the diskless size is cheaper. Check that the pagefile and images don't depend on the local disk before you switch. For managed disk rates, see our Azure disk pricing guide.

How do you use temporary storage safely?
Treat every byte in Azure VM temporary storage as already gone.
- Inventory first. List "d"-size VMs and what they keep locally. Anything beyond pagefile, swap, tempdb, cache or scratch moves to a managed disk.
- Script the setup. On NVMe sizes, format and mount from a startup task or cloud-init, and start dependent services only after the mount succeeds.
- Use nofail and stable paths. Mount by label or /dev/disk/azure/resource rather than /dev/sdb, since device names can change.
- Test the bad day. Run a full stop (deallocate) and start, then a redeploy, in a non-production copy. Confirm the volume, folders and services come back without a human.
- Keep a rollback path. Snapshot OS and data disks before a resize or family change, and keep the old VM until the new one passes checks.
- Verify on the bill. After moving off a "d" size, confirm the new hourly meter in Cost Management a few days later.
Where Lucidity fits
On a "d" size, Azure VM temporary storage is scratch space you've already paid for. The managed data disks next to it are where waste builds up: scratch volumes provisioned at 1 TiB that hold 100 GiB, or disks left attached after a job moved to local storage. Lucidity is a cloud storage optimization platform for that layer. Start with the Assessment, a read-only Free Insights report of disk utilization across subscriptions. AutoScaler expands and shrinks live managed disks with zero downtime, and the Disk Tiering and Idle Disk modules flag disks that are on the wrong tier or not used at all.
Frequently Asked Questions
Does restarting an Azure VM delete the temp disk?
No. Microsoft says data in Azure VM temporary storage persists through a successful standard restart. It can be lost on stop (deallocate), redeploy, maintenance that moves the VM, or a resize that lands on a new host.
Can I back up the Azure temporary disk?
No. The temporary disk isn't a managed disk, so you can't snapshot it, and Microsoft's support matrix states that "Azure Backup doesn't back up temporary disks." If data needs a backup, it belongs on a managed data disk.
Can I make the temp disk larger?
Not directly. The temp disk size is fixed by the VM size, for example 150 GiB on D4ds_v5 and 220 GiB on D4ds_v6. To get more, move to a larger size in the same family.
Why is there no D: drive on my new Azure VM?
Either the size has no local disk (Dsv5, Dsv6 and other sizes without a "d"), or it's a v6 size whose NVMe temp disk is still raw. Check Get-PhysicalDisk for an NVMe Direct Disk, then initialize and format it.
Is the Azure temp disk encrypted?
On v5 and later sizes, yes, automatically at rest. v6 NVMe temp disks use hardware encryption with a platform-managed key. On older sizes, you need encryption at host or Azure Disk Encryption set to all volumes.
.png)




