Deploy a VM Scale Set with a Linux custom image

Last updated: 01-02-2017

This template allows you to deploy a custom VM Linux image inside an Scale Set. These VMs are behind a load balancer with HTTP load balancing (by default on port 80). The example uses a custom script to do the application deployment and update, you may have to provide your custom script for your own update procedure. You will have to provide a generalized image of your VM in the same subscription and region where you create the VMSS.

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
vmSku Size of VMs in the VM Scale Set.
vmssName String used as a base for naming resources. Must be 3-61 characters in length and globally unique across Azure. A hash is prepended to this string for some resources, and resource-specific information is appended.
capacity Number of VM instances (20 or less).
adminUsername Admin username on all VMs.
adminPassword Admin password on all VMs. It must be at least 12 characters in length.
sourceImageVhdUri The source of the blob containing the custom image, must be in the same region of the deployment.
appPackage The source of the application package to copy using the configuration.sh script it should be inside the _artifacts/app folder
destinationFolder path were the appPackage will be copied inside the Linux machine
serviceName name of the service that needs restart when the new package is copied
customScriptName name of the custom script to be run by bash
_artifactsLocation The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated.
_artifactsLocationSasToken The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated.

Use the template

PowerShell

New-AzureRmResourceGroupDeployment -Name <deployment-name> -ResourceGroupName <resource-group-name> -TemplateUri https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/201-vmss-linux-customimage-autoscale/azuredeploy.json
Install and configure 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-vmss-linux-customimage-autoscale/azuredeploy.json
Install and Configure the Azure Cross-Platform Command-Line Interface