Hello Virocs Technologies,
Greetings! Welcome to Microsoft Q&A Platform.
I understand that you created a data disk to VM, but the disk isn’t appearing in the Azure portal. Please consider checking the below following factors to resolve the issue,
Double-check that the disk is properly attached to the VM. You can do this by running,
$vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName
$vm.StorageProfile.DataDisks
This command will list all data disks attached to the VM. Ensure your new disk is listed
- Sometimes, changes take a bit of time to reflect in the Azure portal. Try refreshing the portal or logging out and back in.
- Ensure the disk is in the same resource group and region as your VM. You can verify this in the Azure portal under the disk’s properties.
- After attaching the disk, you might need to mount it within the VM. This can be done using the following PowerShell commands:
$vm = Get-AzVM -ResourceGroupName $rgName -Name $vmName
$vm.StorageProfile.DataDisks | ForEach-Object {
if ($_.Lun -eq 0) {
$_.CreateOption = "Attach"
$_.ManagedDisk = $disk
}
}
Update-AzVM -ResourceGroupName $rgName -VM $vm
If the disk still doesn’t show up, you might need to manually add it through the Azure portal. Go to your VM’s settings, select “Disks,” and then add the data disk from there.
refer - https://learn.microsoft.com/en-us/azure/virtual-machines/windows/tutorial-manage-data-disk, https://learn.microsoft.com/en-us/azure/virtual-machines/windows/os-disk-swap.
Hope this information helps! Please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.Greetings! Welcome to Microsoft Q&A Platform.