Azure / Azure/azure-rest-api-specs

API Microsoft.CostManagement Subscription can't grouping by ResourceGroup on type Forecast

Open
#16,507 4 comments 0 reactions 0 assignees View on GitHub
Cost Management - Query customer-reported question Service Attention
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:
![good](https://user-images.githubusercontent.com/17545722/138390633-e34e8ab1-1fb4-4df0-811d-f88a6dce3348.PNG)

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

Attach Result:
![bad](https://user-images.githubusercontent.com/17545722/138390970-57d052a5-b1b4-4d2a-bd22-83b2d968df5a.PNG)

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

![4](https://user-images.githubusercontent.com/17545722/138391243-da74c76a-f935-459d-bdac-480d085f8335.PNG)
![5](https://user-images.githubusercontent.com/17545722/138391245-f2f9a81a-9904-4010-9051-18006bbaf988.PNG)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.