Skip to main content

Command Palette

Search for a command to run...

Azure VM Recovery: Bring Back a Deleted Virtual Machine (Beginner’s Guide)

Published
3 min read
Azure VM Recovery: Bring Back a Deleted Virtual Machine (Beginner’s Guide)

Hey Cloud Explorers ☁️👋

This week, we focused on something very real in cloud environments, making mistakes like accidentally deleting a Virtual Machine (VM) 😅 …and more importantly, recovering from those mistakes.

This post is about learning to recover a deleted VM using its OS disk on Azure and why that’s such an important skill.


❌ The Scenario

I had a running VM on Azure for testing, called femi-linux-vm.

I deleted the Virtual Machine but made sure NOT to delete its associated OS Disk.

Now the task was:

🔧 Use the leftover OS disk to recreate and recover the VM.

Below is the screenshot of the OS Disk. The easiest way to view your OS Disk is by navigating to your resource group folder.


🧠 Why is it Possible to use an OS Disk to recreate a VM?

When you delete a VM in Azure, it gives you the option to retain the OS disk and other resources (like NICs, IPs, etc.). This means you can reuse that disk to recreate the VM exactly as it was, including all the files and configurations.


🔁 Steps to Recover a Deleted VM Using the OS Disk


✅ 1. Locate the OS Disk:

  1. Go to Azure Portal, then navigate to (Azure services)→ click “Disks”

  1. Look for the disk with a name like:
    femi-linux-vm_OsDisk_1_xxxxx

  2. Make sure it still exists and is in the correct resource group


✅ 2. Create a New VM from the OS Disk

  1. Click on the OS disk → Select “Create VM”

  2. Fill in the required details:

    • VM name: femi-linux-recovered

    • Region: same as the disk

    • Size: same or similar to the deleted VM

    • Authentication: use password or SSH (same as original if possible)

  3. Select an existing Virtual Network or create a new one

  4. Leave defaults for now → Click Review + Create


🧪 Result

Within a few minutes, Azure recreated a new VM using the original OS disk — complete with:

  • It felt like I had reversed time 😎

⚠️ Common Mistakes to Avoid

  • If you delete the OS disk as well, recovery becomes significantly harder (you’ll need backups or snapshots).

  • Ensure the region and availability settings match; otherwise, you may encounter errors.

  • If you can’t connect to the new VM, check:

    • Networking rules

    • SSH or RDP settings

    • NSG (Network Security Group) permissions


💡 Key Takeaways

  • Azure makes it easy to recover resources if you're careful

  • OS disks are like the heart of the VM. Always double-check before deleting

  • Snapshots or backups can further protect you in case the OS disk also gets deleted


If you're also learning how to manage and protect VMs, let’s share tips and grow together 💙

Thanks for reading!

Femi