This repository contains bicep templates for deploying a azure vm scale set.
The template azurevmss-custom-script.bicep deploys an azure vmss
and runs a custom script downloaded from github. We can then fetch output of the script using az vmss commands
- Git clone the repo
- Do an az login in a powershell terminal
- Navigate to
./templatesdirectory - Run
az deployment group create --resource-group <your-resource-group-name> --template-file azurevmss-custom-script.bicep
In order to get the output of the script run the below command
az vmss run-command invoke `
--resource-group <your resource group name> `
--name <your vmss name> `
--instance-id <your vmss instance id> `
--command-id RunPowerShellScript `
--scripts "Get-Content C:\Scripts\script_output.log"