Tuesday, November 3, 2020

Azure VM generalize image backup and restore

This blog explains how to get a generalize image backup of Azure VM and restore it. While Azure VM is up and running, VM incur cost due to processing power and disk usage. As a solution to this, if there is an Azure VM in an idle state we can make a VM image out of it including all the configurations of the VM and remove the VM. Hence, the cost can be reduced as the VM image is stored in the storage and it costs for the storage.

Let's get started


  • Before take the backup, first you need to take generalize the VM using Sysprep.
  1. Sign in to the Azure VM and open the command prompt as administrator.
  2. Change the directory to %windir%\system32\sysprep
  3. run sysprep.exe.
  4. System Preparation Tool dialog box will open. Select Enter System Out-of-Box Experience (OOBE) as system cleanup action.
  5. Select Generalize checkbox.
  6. Select Shutdown as Shutdown Options.
  7. After select above mentioned values, click OK.
  8. Once Sysprp completed, it will shutdown the VM and keep the VM as it is to take the backup.
  • Now VM is generalized and prepared to take a backup.
  • Go to Azure portal and go to the overview of the Azure VM need to be backed up. Click on the Capture.


  • It will navigates to the image creation page.


1 - Provide the name for the image.
2 - Create or select the resource group.
3 - Once VM is generalized it cannot be started again. Hence, this allows to delete the  generalized VM while creating the VM image.
4 - Give the name of the generalized VM.
5 - Click on the create button to create the VM image.

  • You would be able to see the newly created image in the given resource group.
  • Now let's see how can we restore the VM using this image.
  • Start the new VM creation process.
  • While creating the new VM select backed up VM image. To do that click on "Browse all public and private images"


  • It will open a pane where we can select the backed up image.

  • Continue the VM creation process. You will be able to create the VM similar to backed up VM.

In this blog post we have discussed use of the image backup and how to do it. further, we learned how to restore the VM from the backed-up image by creating a new VM.

No comments:

Post a Comment