Creating Virtual Machine Image -Azure

This article cover creating an Azure virtual machine image from an existing Azure v2 virtual machine (VM) using PowerShell.  As of time of this article, imaging in the resource model can only be done using PowerShell. Video and script used in video below.




Steps in the above video covers;

  • Sysprep Operating System
  • Generalize Virtual Machine
    • Put the virtual machine in a generalize state that will allowing virtual machine detail to be copied into a JSON template that can be used to deploy an identical replica of the virtual machine. Once virtual machine it generalized it cannot be used it will need to be deleted.
  • Save as Azure image
    • This creates an image of the virtual machine in the same storage account as the original virtual machine. Image includes OSdisk, Datadisk and JSON template of the virtual machine configuration for redeployment.

Script can be found on GitHub, link below;


Microsoft Azure article covering some of the steps in video

DV2 Series