Azure cost management forescast query

Aayushi Solanki 41 Reputation points
2021-10-18T08:14:12.443+00:00

{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Monthly",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"filter": {
"tag": {
"name": "environment",
"Operator": "In",
"Values": [ "test" ]
}
}
},

}

By using dimension one can fetch forecast data of Resource Group, Location etc. But ho to fetch the forecast data of tags( eg: application owner, application, business unit, etc ).
Tried above code but do not give result.

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

Accepted answer
  1. SadiqhAhmed-MSFT 38,081 Reputation points Microsoft Employee
    2021-10-20T17:56:03.827+00:00

    @Aayushi Solanki Can you start with something like the following and work from there ?

    {
    "type": "ActualCost",
    "dataSet": {
    "granularity": "Daily",
    "aggregation": {
    "totalCost": {
    "name": "Cost",
    "function": "Sum"
    }
    },
    "sorting": [
    {
    "direction": "ascending",
    "name": "UsageDate"
    }
    ],
    "filter": {
    "Tags": {
    "Name": "<tagname>",
    "Operator": "In",
    "Values": [
    "<tagvalue1>"
    ]
    }
    }
    },
    "timeframe": "Custom",
    "timePeriod": {
    "from": "2021-10-01T00:00:00+00:00",
    "to": "2021-10-31T23:59:59+00:00"
    }
    }

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

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

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 21,411 Reputation points MVP
    2021-10-19T08:45:51.427+00:00

    Hi,
    I believe that if you want to have forecast you need to have timePeriod as well in order forecasted data to be generated for future period that has not passed.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments