Issue with auto shutdown while looping multiple VMs #12585
Unanswered
nintendoMan
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a purpose to set up auto shutdown schedules for multiple VMs....
resource vmInstances 'Microsoft.Compute/virtualMachines@2023-07-01' = [for i in range(1, numberOfVms): {
--- VM properties ---
}]
resource autoShutdownConfig 'Microsoft.DevTestLab/schedules@2018-09-15' = [for i in range(1, numberOfVms): {
name: 'shutdown-computevm-${vmPrefix}${i}'
location: location
properties: {
status: 'Enabled'
notificationSettings: {
status: 'disabled'
timeInMinutes: 15
notificationLocale: 'en'
emailRecipient: emailRecipient
webhookUrl: ''
}
dailyRecurrence: {
time: shutdownTime
}
timeZoneId: 'Fle Standard Time'
taskType: 'ComputeVmShutdownTask'
targetResourceId: vmInstances[i].id
}
dependsOn: [
vmInstances
]
}]
MY QUESTION IS:
There seems to be no way to implement via Bicep -> Auto shutdown plan via loops to multiple VMS?
I have trying to use this approach but no solution found.
https://dev.to/massimobonanni/setup-the-auto-shutdown-on-vm-using-bicep-template-5889
Beta Was this translation helpful? Give feedback.
All reactions