Seperate Last 3 months data

Aayushi Solanki 41 Reputation points
2021-10-22T06:33:19.08+00:00

Using azure cost management API, how to get last three months data seperately.
Eg:
July, august september
{
"type": "Usage",
"timeframe": "TheLast3Months",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},

}
}

The above query give combined cost, how to modify query so that it gives each month data of last three month.

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

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 38,081 Reputation points Microsoft Employee
    2021-10-28T20:38:01.017+00:00

    @Aayushi Solanki Thank you for your patience and I apologize for the delayed response!

    You cannot get the three month’s data “separately” based on the query you submitted. Consider Query as an API where you are submitting a workload for execution – and timeframe is an easy moniker to translate the date range you are querying the data for.

    You have to make “Custom” time frame based queries for specific months cost data.

    Said that, I’m curious to understand your scenario and wonder if Query API is the right API pattern for your use case. Can you please share more context on what you are trying to accomplish?

    ----------------------------------------------------------------------------------------------------------------------

    If the response helped, do "Accept Answer" and up-vote it

    0 comments No comments