Right before shutting down the VM, I would like to shut down certain windows services(in the same VM) our application using(graceful shut down). Is there an event in Azure VM that I can hook a powershell script to, so that it executes before shutting down the VM?
The current solution is to keep a schedule for Services shut down and then another schedule to shut down VM(every day). But when we need to deploy in between, then this approach fails.