How to Create/Deploy an Azure VM Image

This week I have been working with ARM Templates, and Azure Images and I would like to share with you a simple procedure to create Azure VM images.

 

Step1

Create a new Azure VM. I have installed a new VM with Windows Server 2019 OS.

Step2

Once VM is installed Install all the prerequisites required for your organization. I installed .Net framework 3.5 from add/remove features and some applications only for this test.

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

Step3

Login to newly created VM and open a command prompt and Sysprep the VM by running:

%windir%\system32\sysprep\Sysprep.exe

Select the options as shown in print screen, this will shutdown the VM once syspreped is completed.


 

 

 

 

 

 


 

 

 

 

Step4

Login to Azure portal. select the VM which was recently syspreped and select Capture from the options


 

 

 

 

 

 

Step5

Use following option:

  • Provide a name for the Image
  • Select the resource Group
  • Select Automatically delete this virtual machine after creating the image


 

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step6

Once completed, Syspreped VM will be deleted. Open the Azure portal and navigate to Image.


 


 

 

 

 

Step7

Select the Image and it will allow to create a new VM from this image


 

 

 

 

 

Step8

New VM can only be created at the same location where the Image is this cant be changed.


 

 

 

 

 

 

 

 

 

 

 

 

  New VM can only use Azure managed disk


 

 

 

 

 

 

 

 

 

 

Once completed a new VM will be created from the VM Image. You can repeat these steps to create multiple VMs from this image.


 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

And that’s all folks!

Take care!

DGM