Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
650 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Does the data will be available once detaching the disk from the vm? Can I use same disk later in sometime with existing data?
Hello @Vamsi krishna Machavarapu
If you detach a disk it is not automatically deleted and all data will be preserved.
You can attach an existing managed disk with your data to a new VM as a data disk.
Using Powershell:
$rgName = "myResourceGroup"
$vmName = "myVM"
$dataDiskName = "myDisk"
$disk = Get-AzDisk -ResourceGroupName $rgName -DiskName $dataDiskName
$vm = Get-AzVM -Name $vmName -ResourceGroupName $rgName
$vm = Add-AzVMDataDisk -CreateOption Attach -Lun 0 -VM $vm -ManagedDiskId $disk.Id
Update-AzVM -VM $vm -ResourceGroupName $rgName
Then Add data disk at OS level
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps
Using Portal: