hi jerred! great question ))
first, u can actually add a simple reboot command right inside ur custom script extension. just slap a 'restart computer' at the end if u're using powershell. like this
Restart-Computer -Force
but hey, if u need a delay (like ur 10-minute idea), u can totally schedule it. this works inside the script too ))
Register-ScheduledTask -Action (New-ScheduledTaskAction -Execute 'shutdown.exe' -Argument '/r /f') -Trigger (New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(10)) -TaskName 'DelayedReboot'
or, if u prefer the azure way, u can trigger a rolling reboot after the extension finishes. https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-manage-cli#reboot-vms-in-a-scale-set
just run az vmss restart --resource-group myResourceGroup --name myScaleSet --instance-ids *
also, if u're dealing with http service changes, maybe just restarting that service could save u time? worth looking into ))
Restart-Service -Name 'HTTP' -Force
as well check this https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows for more on custom script tweaks.
this scheduling trick might help in other tools too. u never know when u'll need a delayed restart ))
hope this sorts it out for u! let us know if u hit any snags...
Best regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer