Detach and delete only a verified unused data disk from VM-MON-01; do not delete its OS disk, because the VM requires that disk to retain its operating system and installed configuration.
Safest portal procedure
- Identify the disk type
- Azure portal → Virtual machines → VM-MON-01 → Settings → Disks.
- Under OS disk, record the disk name and leave it attached.
- Under Data disks, identify the disk that is no longer required.
- Verify the data is not needed
- Confirm that the disk does not contain application data, databases, logs, page files, or mounted application paths.
- If there is any uncertainty, start the VM and verify the disk’s contents and application dependencies from Windows or Linux before removing it.
- For recoverability, create a snapshot or configure Azure Disk Backup before deletion. Azure Disk Backup supports both OS and data disks, including disks that are not currently attached.^1^
- Detach the unused data disk
- Return to VM-MON-01 → Settings → Disks.
- On the data disk’s row, select the Detach button at the far right.
- Select Save.
- Detaching removes the disk from the VM configuration but does not delete it or stop its storage charges.^2^
- Delete the detached disk
- In the portal, search for and select Disks.
- Open the disk that was just detached.
- Confirm Disk state is Unattached and verify its name, resource group, size, and subscription.
- Select Delete and confirm.
Disk deletion is permanent and its data cannot be recovered.^3^
- Validate VM-MON-01
- Start the VM.
- Confirm it boots normally and that its applications and services operate correctly.
- The VM’s OS disk, NIC, private IP configuration, and other networking resources remain unchanged when only a data disk is detached and deleted.
If the disk is the OS disk
An OS disk cannot be detached from an existing VM in the same way as a data disk. To eliminate its storage charge, the VM must no longer be needed and must be deleted along with the OS disk. Azure supports configuring attached resources with either:
- Delete — permanently remove the resource when the VM is deleted.
- Detach — preserve the resource for reuse, but it continues to incur applicable charges.^4^
Before deleting VM-MON-01, review the deletion confirmation carefully and select only the resources that are genuinely no longer needed. Deleting the VM may not automatically delete every disk or networking resource, and retained OS or data disks continue to accrue costs.^5^
Optional PowerShell method for a data disk
Replace the example values with the actual resource group, VM, and disk names:
$vm = Get-AzVM `
-ResourceGroupName "myResourceGroup" `
-Name "VM-MON-01"
Remove-AzVMDataDisk `
-VM $vm `
-Name "unusedDataDisk"
Update-AzVM `
-ResourceGroupName "myResourceGroup" `
-VM $vm
This detaches the disk only. After confirming it is Unattached, delete its disk resource separately to stop its storage charge.^2^
References
- Backup and disaster recovery for Azure managed disks
- How to detach a data disk from a Windows virtual machine
- Find and delete unattached Azure managed and unmanaged disks - Azure portal
- Delete a VM and attached resources
- Plan to manage costs for virtual machines