Skip to content

Commit 6b7959e

Browse files
committed
Self hosted runners: make VM image configurable through environment variable
The image SKU was hidden a bit in the azure-arm-template.json. Let's make it more visible by turning it into a parameter that the CI pipeline can provide. Signed-off-by: Dennis Ameling <[email protected]>
1 parent 62c7234 commit 6b7959e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/create-azure-self-hosted-runners.yml

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ env:
3939
# For more information, see https://learn.microsoft.com/en-us/azure/virtual-machines/dplsv5-dpldsv5-series (which
4040
# unfortunately does not have more information about price by region)
4141
AZURE_VM_REGION: westus2
42+
AZURE_VM_IMAGE: win11-22h2-ent
4243

4344
# The following secrets are required for this workflow to run:
4445
# AZURE_CREDENTIALS - Credentials for the Azure CLI. It's recommended to set up a resource
@@ -130,6 +131,7 @@ jobs:
130131
githubActionsRunnerRegistrationUrl="$ACTIONS_RUNNER_REGISTRATION_URL"
131132
githubActionsRunnerToken="$ACTIONS_RUNNER_TOKEN"
132133
postDeploymentPsScriptUrl="$POST_DEPLOYMENT_SCRIPT_URL"
134+
virtualMachineImage="$AZURE_VM_IMAGE"
133135
virtualMachineName="${{ steps.generate-vm-name.outputs.vm_name }}"
134136
virtualMachineSize="$AZURE_VM_TYPE"
135137
publicIpAddressName1="${{ steps.generate-vm-name.outputs.vm_name }}-ip"

azure-self-hosted-runners/azure-arm-template.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
"osDiskDeleteOption": {
8282
"type": "string"
8383
},
84+
"virtualMachineImage": {
85+
"type": "string"
86+
},
8487
"virtualMachineSize": {
8588
"type": "string"
8689
},
@@ -209,7 +212,7 @@
209212
"imageReference": {
210213
"publisher": "microsoftwindowsdesktop",
211214
"offer": "windows11preview-arm64",
212-
"sku": "win11-22h2-ent",
215+
"sku": "[parameters('virtualMachineImage')]",
213216
"version": "latest"
214217
}
215218
},

0 commit comments

Comments
 (0)