One of the most common questions I get is How does Azure charge for my VM?
Azure charges an hourly price based on the VM’s size and operating system. For partial hours, Azure charges only for the minutes of use. So if your virtual machine ran for less than an hour, you will be charged for the number of minutes your virtual machine is running, rounded up to the nearest minute, not hour. If you create the VM with a VM image containing certain pre-installed software, additional hourly software charges may apply but you will be clearly informed of these when you provision the VM. Azure does however charges separately for storage for the VM’s operating system and data disks. Temporary disk storage is free.
You are charged when the VM status is Running or Stopped, but you are not charged when the VM status is Stopped (De-allocated). So the key thing is if your not using stop it you will still pay for storage associated as the VHD (the Image sits on Azure Storage so you pay minimal costs for de-allocated VMs) see the FAQ at
Top Tip: When creating new VMS if you should ideally organise your related resources into resource groups. Resource Groups helps us to logically group the Azure resources together and monitor and manage them. As An Example a resource group per machine or class. i.e. Deep Learning Resource Group, Which holds the VM and Associated services once the class is complete, you can delete the entire
resource group with a few clicks
, which should help manage costs and resources again you may simply want to de-allocate these and restart the services for the next Semester.
Azure is a huge service which is growing a tremendous rate last we added over 500 services we have now began to consolidate all our documentation under a single location see
To put a VM in the Stopped (De-allocated) state, do one of the following:
For SDK and cmd line tools to script and automation
Go to your VM blade in Azure portal.
Auto-shutdown in the resource menu on the left-side. You will see an auto-shutdown settings page expanded, where you can specify the auto-shutdown time and time zone. You can also configure to send notification to your webhook URL 15 minutes before auto-shutdown.
If the status says “Stopped (De-allocated)”, you aren’t being billed.
If it says “Stopped Allocated”, you’re still being billed for allocated virtual cores (not the software licence itself).
Top Tip : To ensure you aren’t being billed, always stop virtual machines from the management portal. You can also stop the virtual machine via Powershell by calling ShutdownRoleOperation with “PostShutdownAction” equal to “StoppedDeallocated”.