[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:

 

test2-1-624x196

 

Link to my blog with the complete script:

 

http://paegelow.se/azure-automation-runbook-retrieve-total-cost-of-resourcegroup-or-subscription/

 

Required modules:

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

 

Guide on how to create an azure runbook:

https://docs.microsoft.com/en-us/azure/automation/automation-quickstart-create-runbook

0 Replies