-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[BUG] CostManagement - grouping by ConsumedService not working #36332
Copy link
Copy link
Open
Labels
Cost Management - QueryAll issues in cost management associated with tags, dimensions and forecasts.All issues in cost management associated with tags, dimensions and forecasts.MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.Service AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
Metadata
Metadata
Assignees
Labels
Cost Management - QueryAll issues in cost management associated with tags, dimensions and forecasts.All issues in cost management associated with tags, dimensions and forecasts.MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.Service AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
API Spec link
https://github.com/Azure/azure-rest-api-specs/tree/baa334a7838faa6f39e7d5c2124934e0e93ea388/specification/cost-management/resource-manager/Microsoft.CostManagement/stable
API Spec version
2025-03-01
Describe the bug
We were regularly using
POST https://management.azure.com/{scope}/providers/Microsoft.CostManagement/query?api-version=2019-01-01on subscriptions scope to get cost details for several years without any issues.After 25th of June this year API calls started failing with Error message:
BadRequest","message":"Invalid query definition: Invalid dataset grouping: 'ConsumedService'
We tried to bump API version to 2025-03-01 but behavior is the same.
Expected behavior
Call
POST https://management.azure.com/{scope}/providers/Microsoft.CostManagement/query?api-version=2025-03-01on subscriptions scope with grouping onConsumedServicesucceededActual behavior
Call
POST https://management.azure.com/{scope}/providers/Microsoft.CostManagement/query?api-version=2025-03-01on subscriptions scope with grouping onConsumedServicefails with:Reproduction Steps
You can use: https://learn.microsoft.com/en-us/rest/api/cost-management/query/usage?view=rest-cost-management-2025-03-01&tabs=HTTP&tryIt=true&source=docs#code-try-0 to test it.
POST https://management.azure.com/subscriptions/(subscriptionID)/providers/Microsoft.CostManagement/query?api-version=2025-03-01
{
"dataSet": {
"granularity": "Daily",
"sorting": [
{
"direction": "ascending",
"name": "UsageDate"
}
],
"grouping": [
{
"type": "Dimension",
"name": "ResourceId"
},
{
"type": "Dimension",
"name": "ResourceType"
},
{
"type": "Dimension",
"name": "ResourceGroupName"
},
{
"type": "Dimension",
"name": "ConsumedService"
}
]
},
"timeframe": "Custom",
"timePeriod": {
"from": "2025-07-21T00:00:00+00:00",
"to": "2025-07-21T23:59:59+00:00"
},
"type": "ActualCost"
}
Environment
No response