Create Custom Image in Azure
This article this show to create custom image with desired configuration and tool sets. Microsoft Azure allows to create Windows Server templates and if you desire you create multiple VMs with pre-installed roles or applications, then you could create a new VM, deploy the roles & later sysprep the Image to save as Disk for future Deployments.
To begin with, login to your Windows Azure Portal and create a new Windows Server VM. I have created Windows Server 2012 VM and have named it sarvesh-test
2. Login to VM, and deploy roles / applications that you want to go as standard on all machines for next deployments. For the purpose of this article, I will be installing Desktop Experience Windows feature on the Image.
Please note that there could be certain applications that do not support sysprep and they need to be deployed after the Image is built.
3. Once Windows roles and applications are deployed, you would need to run Sysprep on the Image. Go your Windows Installation directory, open Sysprep folder, and launch syspep.exe. Select the options as shown below.
4, Once the sysprep is complete, and Virtual Machine is in shutdown state. Go to the VM in Microsoft Azure Portal and click on Capture button.
Provide the machine name here, and some description that best defines purpose of the Image. Don’t forget to select I have run Sysprep on the virtual machine option, this tells Azure that VM is now ready for deployments.
5. Once the job completes, you would see the Master Image on the Azure, as shown below.
6. Now we are ready for deploying the Virtual Machines. Use the same process to create a Virtual Machine but now instead of selecting Microsoft Images, you now go to MY IMAGES section on the left hand side frame and select the Image that was just created to deploy.
7. On moving further on the wizard, proceed with the desired / normal steps to create the VM, like provide its name, Cloud Service etc., as shown below
8. And cloud service, Network etc.
9. Finally, deploy the VM agent and select if you need any Configuration Extensions to deploy along with VM.
10. Once the VM is deployed, you will see the Windows feature Desktop Experience that we had previously is added to the VM.
This completes the configuration. In the next part of this Article series, you would see most of these activities using PowerShell and how to create multiple VMs along with custom software deployments after the VM is created, with some cool Automation stuff.