Last month I was surprised to see that my Azure bill went up quite a bit. Not knowing that I forgot to deallocate my Azure development VMs. Fortunately, this didn’t break the bank, but would like to avoid this in the future. So therefore I created a simple script to Deallocate Azure VM’s.
Creating a Deallocate Azure VM’s script
I wanted to avoid using a witness server given that the VM’s only exist for demo and experimenting purposes (poor man’s solution warning!).
Just alter the parameter s and schedule execution via Windows Task Scheduler on the VM.
ATTN: I recently wrote a guide on how to automate this process using Microsoft Azure Automation. The blog post can be found here.