This repo contains a set of Bicep files that demonstrate Azure Image Builder (AIB) and Virtual Machine Scale Sets (VMSS) working together.
For the purposes of the demonstration, AIB takes a Windows Server 2019 image from the Azure Marketplace and then adds the IIS roles and features. AIB then publishes the resulting image into a shared image gallery. Once the image has been successfully created, a VMSS is then created from that image.
We have also demonstrated how you can use a custom script extension on the scale set to perform post-boot configuration on the VMs.
-
Create a resource group.
-
Deploy the main.bicep file, such as by running the following command:
az deployment group create -g MyResourceGroup -f ./main.bicep
The deployment will take some time - potentially an hour or more.
-
Once the deployment succeeds, you can access the VMSS through a web browser, or using RDP.
The main.bicep file does the following, in sequence:
- Deploys Azure Image Builder and a shared image gallery.
- Runs Azure Image Builder to build an image.
- Deploys a VM scale set that uses the image.
The second step is necessary because AIB requires you to explicitly run the build process. An ARM deployment script is used to execute the operation.