1

I'd like to retrieve the current cost of my azure usage using the cli. On the Azure UI I can easily see the total costs in Subscriptions:

azure subscription list with cost

The closest I can get to retrieving costs is using the az consumption usage list command:

az consumption usage list --debug --end-date 2019-07-19 --start-date 2019-07-01

This command gives me an extremely fine-grained list of the services I've been using along with their costs. All I want is the simple sum.

I'm wondering if there is a way to directly retrieve the totals?

zoltanctoth
  • 2,788
  • 5
  • 26
  • 32
  • Hi zoltanctoth, have you solved this problem? I'm facing it just now – Giova Feb 06 '20 at 15:57
  • @Giova I have an ugly hack which gives us an approximate. Far from ideal, but serves our purposes at the time. Here you go: https://gist.github.com/zoltanctoth/eb3ff39efe779a7790e94f3b387827f7 – zoltanctoth Feb 09 '20 at 11:31
  • I created a cli tool to extract the cost that might help you https://github.com/mivano/azure-cost-cli – Michiel Apr 15 '23 at 11:57

0 Answers0