Skip Navigation

Blue-green Deployment to Virtual Machine ScaleSet with Jenkins

Last updated: 4/18/2018

This template allows you to do blue/green deployment to a VMSS cluster using Jenkins. It provisions a Jenkins master on a VM running on Azure, configures a DevOps pipeline to bake a managed OS image with Tomcat 7 or 8 installed and deploys it to the VMSS. It is an example to demonstrate how we can use Jenkins pipeline to do blue/green deployment on VMSS.

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

Parameters

Parameter Name Description
resourceNamePrefix Prefix for the resource names.
adminUsername User name for the Virtual Machine hosting the Jenkins and the Virtual Machines in VMSS.
sshPublicKey Configure all linux machines with the SSH public key string, for example 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'
virtualMachineSize The virutal machine size to use. See https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes
jenkinsDNSPrefix Unique DNS name prefix for the public IP used to access the Jenkins service.
tomcatDNSPrefix Unique DNS name prefix for the public IP used to access the Tomcat service.
servicePrincipalAppId Service Principal App ID (also called Client ID) that has contributor rights to the subscription used for this deployment. It is used to manage related Azure resources, e.g., bake OS image, check resource status, update VMSS image, etc.
servicePrincipalAppKey Service Principal App Key (also called Client Secret) that has contributor rights to the subscription used for this deployment. It is used to manage related Azure resources, e.g., bake OS image, check resource status, update VMSS image, etc.
_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.
location Location for all resources.

Use the template

PowerShell

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