Create VM from a custom image in new storage account

Last updated: 25/03/2016

Cost estimate

$208.4577000000

Estimated monthly cost

Understand how this was calculated and customise it to your needs

Pricing calculator

This template allows you to create a new Virtual Machine from a custom image on a new storage account deployed together with the storage account, which means the source image VHD must be transferred to the newly created storage account before that Virtual Machine is deployed. This is accomplished by the usage of a transfer virtual machine that is deployed and then uses a script via custom script extension to copy the source VHD to the destination storage account.

This Azure Resource Manager (ARM) template was created by a member of the community and not by Microsoft. Each ARM template is licensed to you under a licence agreement by its owner, not Microsoft. Microsoft is not responsible for ARM templates provided and licensed by community members and does not screen for security, compatibility or performance. Community ARM templates are not supported under any Microsoft support programme or service, and are made available AS IS without warranty of any kind.

Parameters

Parameter Name Description
transferVmName Name of the Windows VM that will perform the copy of the VHD from a source storage account to the new storage account created in the new deployment, this is known as transfer vm.
vmSize VM size of new virtual machine that will be deployed from a custom image.
newVmName Name of the new VM deployed from the custom image.
customImageName Name of the VHD to be used as source syspreped/generalized image to deploy the VM. E.g. mybaseimage.vhd.
adminUserName Name of the local administrator account, this cannot be Admin, Administrator or root.
adminPassword Local administrator password, complex password is required, do not use any variation of the password word because it will be rejected.
sourceStorageAccountResourceGroup Resource group name of the source storage account.
sourceImageURI Full URIs for one or more custom images (VHDs) that should be copied to the deployment storage account to spin up new VMs from them. URLs must be comma separated.

Use the template

PowerShell
New-AzureRmResourceGroupDeployment -Name <deployment-name> -ResourceGroupName <resource-group-name> -TemplateUri https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/201-vm-custom-image-new-storage-account/azuredeploy.json
Installing and configuring Azure PowerShell
Command line
azure config mode arm
azure group deployment create <my-resource-group> <my-deployment-name> --template-uri https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/201-vm-custom-image-new-storage-account/azuredeploy.json
Installing and configuring the Azure cross-platform command-line interface

More templates by Paulo Marques