Preventing charges for an Azure VM when not in use

When you shutdown an Azure VM, you still get charged for usage.  That’s because the hardware for your VM is still allocated/dedicated to you.  It’s just not being used.  To prevent charges, you can delete the VM.  When you do that, your .vhd file(s) don’t’ get deleted.  Therefore, you can recreate the VM rather quickly when you want to start using it again.  While you can do this manually, it can become tedious depending on how often you need to do it.  The good news is that you can automate this process using PowerShell.  You’ll need to make sure you’ve run through Getting Started with Windows Azure PowerShell first.  Then you can follow the instructions from Importing and Exporting Virtual Machine Settings.  I keep this post handy since I create and delete my VM as needed so I am only charged for the time I am actually using it.


Comments (3)

  1. Now that Microsoft no longer charges for VMs that aren't running, I'd love to see these instructions updated for just making sure they aren't running. Last night I forgot and left my VM running when I left the office. How hard would it be to force a shutdown at a certain time of day?

  2. Dmitry says:

    Michael, look for Azure Powershell scripts, there are ones to start and shutdown your VM. Microsoft still charges for VMs that are stopped, so you need to use PowerShell script to ensure it's off.…/scripts

  3. Kurt Richardson says:

    According to this question (…/stopped-deallocated), and the response from Microsoft, you are no longer billed for VM use when it has been shut down.  Note that you have to shut it down via the Azure Portal, not from within the VM itself.

Skip to main content