Azure VM costs for developers

Today, many IT companies use Azure resources to learn, test, create proof of concepts, etc. Sometimes the company uses Microsoft credits for this, and sometimes it’s a subscription paid by the company. In my article, I would like to present how to create virtual machines to minimize their cost.

TL;TR

  • Don’t use Premium SSD on test or POC environment
  • Configure auto-shutdown for VM
  • Configure budget and alerts for resource group where you created VM
  • Create disk snapshot and delete VM if you don’t use VM
  • Install Azure mobile app to control your VM anytime, anywhere.

Disks

When you creating a VM, the default option for a disk is a Premium SSD, the expensive one dedicated mostly for production.

In case of test or proof of concept purpose you can use Standard SSD.

Monthly cost of 128 GB disk per type.

Auto shutdown

An automated shutdown is an additional option that helps you save some money. You can specify a time when Azure will automatically shut down VM, but no worries, Azure will notify you by email that VM will be off soon, and you can postpone this process.

Tags

The use of tags does not give you any savings, but it allows you to quickly find out who created the resources in Azure and for what. You can also find in logs, who create resources, but this information is available only by two weeks as far as I remember. I always recommend using at least an owner tag to have a contact person responsible for resources.

Budgets and alerts

If you are not familiar with Azure resources costs, it’s recommended to configure a budget for a resource group where you created your VM. Additionally, you can create several alarms when resources consume the % of the budget. Alerts will allow you to react early and keep a budget on the expected level.

Snapshots

Many times when I ask colleagues

  • “Do you still need this VM for tests?”
  • “Sure, every day.”
  • “Why CPU usage by last seven days was 0%?
  • “Well, our application is highly optimized.”
CPU and network usage by last 7 days

If you are not using VM but want to keep VM state for some time (forever), you can create a disk snapshot and restore VM when necessary.
Please describe this snapshot well; otherwise, nobody will remember what it is and what is there. It’s also good to leave a readme.txt on the desktop with a more detailed description of the snapshot state and purpose. When in the future (never) you will restore this VM, a great lecture will wait on the desktop.


Snapshot is much cheaper than Standard SSD and public IP assigned to VM, but not used because VM is off.

Azure Mobile App

With the Azure mobile app, you will have control over your Azure resources anytime and anywhere; just an Internet connection is required. I remember that I fixed VM at the airport some time ago using cloud shell on the mobile phone. 

Screenshots from App Store

Credits: Photo by maitree rimthong from Pexels

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.