Over the years, this blog has been about many different things related to software development with Microsoft technologies. Since my current role focuses on Dynamics CRM / XRM, that's what it's primarily about right now.

Preventing charges for an Azure VM when not in use

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.