I'm trying to find a way to have Azure automatically email me the costs for all my subscriptions each month. I can currently view all subscriptions and their costs on the cost analysis page and can download that information, but I'm looking for a more automated solution. I noticed there's an export feature to storage, but I'd prefer to receive it via email. Is there an easy way to set this up?
2 Answers
I've got a PowerShell script running as a runbook in Azure Automation that does exactly this. It’s tied to a service principal with the right permissions on the subscriptions. This way, when new subscriptions are added at the management group level, they're automatically included. At the end of each month, it sends out the cost and usage for each subscription, which is great for a quick overview, but for alerts on over-budget usage, I recommend setting up budgets.
You could try setting up a Logic App linked to your storage account that sends you an email with the exported billing data. It's a pretty handy way to automate it!
That sounds like a solid plan! I’ll check out how runbooks work.