@@ -18,49 +18,49 @@ echo "Capacity: $CAPACITY"
1818# Check if VMSS exists
1919if az vmss show --resource-group " $RESOURCE_GROUP " --name " $VMSS_NAME " & > /dev/null; then
2020 echo " VMSS $VMSS_NAME already exists, scaling to $CAPACITY "
21- az vmss scale `
22- --resource-group " $RESOURCE_GROUP " `
23- --name " $VMSS_NAME " `
21+ az vmss scale \
22+ --resource-group " $RESOURCE_GROUP " \
23+ --name " $VMSS_NAME " \
2424 --new-capacity " $CAPACITY "
2525else
2626 echo " Creating new VMSS: $VMSS_NAME "
2727
2828 # Create VMSS with system-assigned identity (more reliable)
29- az vmss create `
30- --resource-group " $RESOURCE_GROUP " `
31- --name " $VMSS_NAME " `
32- --image " $CUSTOM_IMAGE_ID " `
33- --upgrade-policy-mode automatic `
34- --admin-username runneradmin `
35- --admin-password ' dbatools.I00' `
36- --instance-count " $CAPACITY " `
37- --vm-sku Standard_B4ms `
38- --location eastus2 `
39- --license-type Windows_Server `
40- --orchestration-mode Uniform `
41- --priority Regular `
42- --ephemeral-os-disk true `
43- --assign-identity `
44- --tags `
45- owner=" $GITHUB_ACTOR " `
46- branch=" $BRANCH_NAME " `
47- purpose=' dbatools-ci' `
48- build_id=" $BUILD_ID " `
29+ az vmss create \
30+ --resource-group " $RESOURCE_GROUP " \
31+ --name " $VMSS_NAME " \
32+ --image " $CUSTOM_IMAGE_ID " \
33+ --upgrade-policy-mode automatic \
34+ --admin-username runneradmin \
35+ --admin-password ' dbatools.I00' \
36+ --instance-count " $CAPACITY " \
37+ --vm-sku Standard_B4ms \
38+ --location eastus2 \
39+ --license-type Windows_Server \
40+ --orchestration-mode Uniform \
41+ --priority Regular \
42+ --ephemeral-os-disk true \
43+ --assign-identity \
44+ --tags \
45+ owner=" $GITHUB_ACTOR " \
46+ branch=" $BRANCH_NAME " \
47+ purpose=' dbatools-ci' \
48+ build_id=" $BUILD_ID " \
4949 created=" $( date -u +%Y-%m-%dT%H:%M:%SZ) "
5050
5151 # Get system-assigned identity principal ID
52- SYSTEM_PRINCIPAL_ID=$( az vmss show `
53- --resource-group " $RESOURCE_GROUP " `
54- --name " $VMSS_NAME " `
55- --query " identity.principalId" `
52+ SYSTEM_PRINCIPAL_ID=$( az vmss show \
53+ --resource-group " $RESOURCE_GROUP " \
54+ --name " $VMSS_NAME " \
55+ --query " identity.principalId" \
5656 --output tsv)
5757
5858 echo " System identity principal ID: $SYSTEM_PRINCIPAL_ID "
5959
6060 # Assign Key Vault permissions to system identity
61- az role assignment create `
62- --role " Key Vault Secrets User" `
63- --assignee " $SYSTEM_PRINCIPAL_ID " `
61+ az role assignment create \
62+ --role " Key Vault Secrets User" \
63+ --assignee " $SYSTEM_PRINCIPAL_ID " \
6464 --scope " /subscriptions/$SUBSCRIPTION_ID /resourcegroups/dbatools-ci-runners/providers/Microsoft.KeyVault/vaults/dbatoolsci"
6565
6666 # Wait for role assignment propagation
7070
7171# Add Custom Script Extension to run setup
7272echo " Adding Custom Script Extension..."
73- az vmss extension set `
74- --resource-group " $RESOURCE_GROUP " `
75- --vmss-name " $VMSS_NAME " `
76- --name CustomScriptExtension `
77- --publisher Microsoft.Compute `
78- --version 1.10 `
73+ az vmss extension set \
74+ --resource-group " $RESOURCE_GROUP " \
75+ --vmss-name " $VMSS_NAME " \
76+ --name CustomScriptExtension \
77+ --publisher Microsoft.Compute \
78+ --version 1.10 \
7979 --protected-settings " {
8080 \" fileUris\" : [\" https://raw.githubusercontent.com/dataplat/dbatools/vmss/.github/scripts/runner-setup.ps1\" ],
8181 \" commandToExecute\" : \" powershell -ExecutionPolicy Unrestricted -File runner-setup.ps1\" ,
0 commit comments