Automatically pull usage + charges csv and filter it

user123 1 Reputation point
2020-10-26T13:40:02.167+00:00

Hi, I am trying to figure out if this is possible. I want the monthly usage + charges csv under cost management to be automatically pulled and filtered by resource group. Currently the way I do it is manually download the csv and put it into Power BI and filter through that but I am wondering if it's possible to set this up to be done automatically. If this could be done I would also like to set up a way to automatically e-mail the people responsible for each resource group so everyone knows their costs rather than manually emailing each one. I haven't found out how to do this through searching so looking for any help :)

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,285 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 40,441 Reputation points Microsoft Employee
    2020-10-30T07:33:14.94+00:00

    Exports is positioned to get you access to the data – that you could appropriately do the client side filtering using your favorite toolset. But it appears your ideal scenario is once a month scheduled email with specific resource group view to your target audience. This feature (Scheduled Emails) is in our backlog.

    In the interim, Are you open to having a piece of automation on your side to use our APIs to get the filtered data once a month and trigger an email?

    here is what you can do:

    • Use Azure Cost Management Query API to generate the usage for the invoice period using the custom timeframe value.
    • Convert the JSON response to CSV.
    • Export the file to Storage Account.

    Currently, the Query API supports grouping up to 10 dimensions. If you need the complete dataset, you can use Usage List API instead of Query API. In the Usage List API, you can specify the start and end date (as per your invoice) using the $filter parameter.

    1 person found this answer helpful.