Create Windows Custom Image – Azure Resource Manager
To see Create Linux Custom Image on Azure Resource Manager – Follow 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.
Now login to this Virtual Machine, make your changes like setting up policies, deploy applications, firewall settings etc. and run Sysprep, as shown below –
The sysprep process will shutdown the Virtual Machine (shown below) but will not de-allocate the Azure resources.
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>
Now, stop the Azure VM to de-allocate the resources using the command below
Now, confirm the same on Azure Portal
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
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
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
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