Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fbenatti opened this issue Oct 22, 2021 · 4 comments
Labels
Cost Management - Query All issues in cost management associated with tags, dimensions and forecasts. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@fbenatti
Copy link

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

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

Attach Result:
bad

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

4
5

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.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 22, 2021
@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 22, 2021
@zhenglaizhang zhenglaizhang added Cost Management Service Attention Workflow: This issue is responsible by Azure service team. labels Oct 26, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 26, 2021
@ghost
Copy link

ghost commented Oct 26, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ms-premp, @ramaganesan-rg.

Issue Details

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

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

Attach Result:
bad

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

4
5

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.

Author: fbenatti
Assignees: zhenglaizhang
Labels:

question, Service Attention, customer-reported, Cost Management, needs-triage

Milestone: -

@ShilpiGautam ShilpiGautam added Cost Management - Query All issues in cost management associated with tags, dimensions and forecasts. and removed Cost Management labels Oct 28, 2021
@ShilpiGautam
Copy link

Applying the correct tag so that its gets routed to right team. Cost Management tag is deprecated. We have more granular tags for right routing.

@omrodrig
Copy link
Contributor

The sample response for the Forecast response is misleading. This API only returns the columns PreTaxCost, UsageDate, CostStatus, and Currency. I will update this accordingly.

@fbenatti
Copy link
Author

Instead of fixing the documentation, why don't you fix the API to return the "forecast" equal to the value I return in the "Query" type with ResourceGroup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cost Management - Query All issues in cost management associated with tags, dimensions and forecasts. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants