Create Windows Custom Image using Azure Resource Manager

Create Windows Custom Image using Azure Resource Manager

Create Windows Custom Image – Azure Resource Manager

To see Create Linux Custom Image on Azure Resource ManagerFollow this link

This post will show you how to create Custom Image on Azure new portal also known as Azure Resource Manager portal (https://portal.azure.com), this post focuses on creating Windows Image that can be used to deploy multiple VMs in the future using template based deployment.

First, deploy a Windows 2012 Image from Azure Market Place.

Custom-Image-Windows-ARM-01

Now login to this Virtual Machine, make your changes like setting up policies, deploy applications, firewall settings etc. and run Sysprep, as shown below –

Custom-Image-Windows-ARM-02

The sysprep process will shutdown the Virtual Machine (shown below) but will not de-allocate the Azure resources.

Custom-Image-Windows-ARM-03

Now login to Azure PowerShell and login to your account using Login-AzureRMAccount command. Once logged in, run below command to select using Subscription

Select-AzureRmSubscription -SubscriptionId <id>

Custom-Image-Windows-ARM-04

Now, stop the Azure VM to de-allocate the resources using the command below

Custom-Image-Windows-ARM-05

Now, confirm the same on Azure Portal

Custom-Image-Windows-ARM-06

Now, generalize the Azure VM, to use the VM as master Image for future deployments.

Please remember that Generalized VMs can’t be started and thus can’t be used

Custom-Image-Windows-ARM-07

Once VM is generalized, save the Virtual Machine to a storage account and create a JSON file that can be referred for templatized deployment of resources

Custom-Image-Windows-ARM-08

Now, open the JSON file and that contains parameters and settings for new VM deployment, most important being URI of the VHD for Image deployment

Custom-Image-Windows-ARM-09

Note the path of the VHD, and update in your JSON file for deploying VMs using this Image.

Deploy Custom Image using Azure Resource Manager (ARM) templates

Click here to download JSON file for Custom Image Deployment

 

 

About The Author

Related posts

Leave a Reply

Your email address will not be published. Required fields are marked *