[Guide] Automation Runbook – Retrieve total cost of resourcegroup or subscription

Brass Contributor

Hello geeks!


I wanted to share a script i use on a daily basis that i think some of you have use of.


What this script/runbook achieves:

This script retrieves all resources in a resourcegroup, sums up the values of each resource, and emails the total cost via gmail SMTP.


What i get in the mail once a day:




Link to my blog with the complete script:




Required modules:

  • AzureRM.Automation
  • AzureRM.Consumption
  • AzureRM.Profile
  • AzureRM.Resources
  • AzureRM.Storage
  • AzureRM.Compute


Guide on how to create an azure runbook:


0 Replies