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.
Create a new Azure VM. I have installed a new VM with Windows Server 2019 OS.
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.
Login to newly created VM and open a command prompt and Sysprep the VM by running:
Select the options as shown in print screen, this will shutdown the VM once syspreped is completed.
Login to Azure portal. select the VM which was recently syspreped and select Capture from the options
Use following option:
Provide a name for the Image
Select the resource Group
Select Automatically delete this virtual machine after creating the image
Once completed, Syspreped VM will be deleted. Open the Azure portal and navigate to Image.
Select the Image and it will allow to create a new VM from this image
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!