Azure / Azure/azure-rest-api-specs
API Microsoft.CostManagement Subscription can't grouping by ResourceGroup on type Forecast
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
Hello,
When I call the api .CostManagement SubscriptionForecast with type "Query" the response return data with ResourceGroup, but not return the forecast value. If I use the same JSON body and chage the type of call to forecast, don't return more grouping by ResourceGroup and return the CostStatus with Forecast but stop return ResourceGroup:
Examples working grouping by ResourceGroup, but don't return with CostStatus Forecast values, the response stop on today date.
-> POST https://management.azure.com/subscriptions/subscriptions_ID/providers/Microsoft.CostManagement/Query?api-version=2021-10-01
-> JSON Body:
{
"type": "ActualCost",
"dataset": {
"granularity": "Daily",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
},
"timeframe": "Custom",
"timePeriod": {
"from": "2021-10-01T00:00:00+00:00",
"to": "2021-10-31T23:59:59+00:00"
},
"includeActualCost": true,
"includeFreshPartialCost": false
}
Attach Result:

POST https://management.azure.com/subscriptions/subscriptions_ID/providers/Microsoft.CostManagement/forecast?api-version=2021-10-01
JSON Body: Same above.
Attach Result:

What said documentation:
https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage#subscriptionforecast


How I can call the API POST subscriptions/subscriptions_ID/providers/Microsoft.CostManagement/forecast with this columns?
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "CostStatus",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
Thanks.
Contributor guide
Research direction
Start by comparing the SubscriptionForecast endpoint at /subscriptions/{id}/providers/Microsoft.CostManagement/forecast with the linked Cost Management forecast documentation and the supplied request and response examples. Determine whether grouping by ResourceGroup with CostStatus and forecast values is supported, then update the relevant API specification or documentation so the supported request and response are clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100