This repository shows how to create a VM Scale Set from an Golden image published to the Azure Shared Image Gallery. It uses Azure DevOps Pipelines for CI/CD. The Pipelines are defined in the Pipelines directory.
- SharedImageAndScaleSet.build.yaml - This just copies the json scripts in preperation release. Should use a linter to check json syntax
- SharedImageGalley.release.yaml - Created a Golden image using Packer and distribute the image via Shared Image Gallerys to multiple Azure regions
- ScaleSet.release.yaml - Creates a 5 node Azure Scale Set from the Golden Image.
- Register for Shared Image Gallery Preview - https://azure.microsoft.com/en-us/blog/announcing-the-public-preview-of-shared-image-gallery/
- Run the following to setup a Shared Image Gallery:
publisher="bjdazure.demo"
gallery="BjdAzureDemoGallery"
offer="BaseIISStandard"
sku="BaseIIS"
replica=1
location="southcentralus"
RG="Shared_Images_RG"
az group create -n $RG -l $location
az sig create -g $RG --gallery-name $gallery
az sig image-definition create -g $RG --gallery-name $gallery --gallery-image-definition $offer --publisher $publisher --offer $offer --sku $sku --os-type Windows
- The Golden Image is created from the base Azure Windows 2016 Datacenter Image
- IIS is installed and a default page created.
- This process is handled by Packer using Azure DevOps autogenerated Packer Template. A custom template can also be supplied.
- The VMSS image is created from the Golden Image created above
- A powershell script determines the latest build via the buildid tag on image
- A new VM image will be created with additional code deployed to IIS
- An Azure Load Balancer is created and the Scale Sett attached to it.