Skip to content

Commit 36ee081

Browse files
committed
Add vmSizeCustom param to override VM SKU
1 parent 1815d02 commit 36ee081

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

linux/vm-tailscale/vm.bicep

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ param vmName string = 'vm1'
1515
])
1616
param vmSize string = 'Standard_B2s_v2'
1717

18+
@description('Custom VM size (overrides vmSize if set).')
19+
param vmSizeCustom string = ''
20+
1821
@description('The Storage Account Type for OS and Data disks.')
1922
@allowed([
2023
'Standard_LRS'
@@ -215,7 +218,7 @@ resource vm 'Microsoft.Compute/virtualMachines@2024-03-01' = {
215218
}
216219
properties: {
217220
hardwareProfile: {
218-
vmSize: vmSize
221+
vmSize: vmSizeCustom != '' ? vmSizeCustom : vmSize
219222
}
220223
storageProfile: {
221224
osDisk: {

linux/vm-tailscale/vm.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.40.2.10011",
8-
"templateHash": "15889812350987912667"
8+
"templateHash": "9014597243353373291"
99
}
1010
},
1111
"parameters": {
@@ -34,6 +34,13 @@
3434
"description": "The Virtual Machine size."
3535
}
3636
},
37+
"vmSizeCustom": {
38+
"type": "string",
39+
"defaultValue": "",
40+
"metadata": {
41+
"description": "Custom VM size (overrides vmSize if set)."
42+
}
43+
},
3744
"diskAccountType": {
3845
"type": "string",
3946
"defaultValue": "Premium_LRS",
@@ -252,7 +259,7 @@
252259
},
253260
"properties": {
254261
"hardwareProfile": {
255-
"vmSize": "[parameters('vmSize')]"
262+
"vmSize": "[if(not(equals(parameters('vmSizeCustom'), '')), parameters('vmSizeCustom'), parameters('vmSize'))]"
256263
},
257264
"storageProfile": {
258265
"osDisk": {

0 commit comments

Comments
 (0)