Need to check your Azure VM costs? Use this script

Most of the time, when we want to check consumption to keep an eye on our Azure VM costs, we use Azure Portal because it is easier to narrow down and get the number that you are looking for.

Sometimes, you may want to do a quick check on a given VM to identify the costs, and that is one of the requests that I received today. We have the Get-AzConsumptionUsageDetail cmdlet that helps exactly on that front. However, the output has a lot of information and lacks totals, which makes it harder when you need a simple answer like how much that VM cost last month or the cost so far this month.

I created a script that you provide the VM name, and it will give you the cost of the current cycle and the previous month.

You can use the following link to get access to the Azure VM costs script.

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides of the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange, CISSP and several other certifications. Anderson contributes to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at,, and Anderson (Portuguese).

Published by
Anderson Patricio

Recent Posts

EseUtil or Stellar Repair: Which Exchange disaster-recovery tool is better?

Every Exchange Server admin at some point needs a disaster-recovery tool. Here’s a comparison of…

10 hours ago

ADT tech pleads guilty to spying on customers while they had sex

ADT has built a business on protecting people. But one ADT home security tech did…

13 hours ago

Does it make sense to run apps inside of Microsoft Teams?

Microsoft makes it possible to add apps that you may already use as standalone programs…

16 hours ago

SonicWall warns users about zero-day vulnerabilities

SonicWall is warning of a coordinated zero-day attack on some of its remote access products.…

1 day ago

Why Salesforce DevOps teams need version control

Version control is an essential part of software development. This is true especially for Salesforce…

2 days ago

Irritating advances in technology and why we love to hate them

Technology makes lives much easier. Until it doesn’t. Here’s a look at some advances in…

4 days ago