Skip to content

[BUG] CostManagement - grouping by ConsumedService not working #36332

Description

@mbaranovych

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-01 on 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-01 on subscriptions scope with grouping on ConsumedService succeeded

Actual behavior

Call POST https://management.azure.com/{scope}/providers/Microsoft.CostManagement/query?api-version=2025-03-01 on subscriptions scope with grouping on ConsumedService fails with:

Error message:
BadRequest","message":"Invalid query definition: Invalid dataset grouping: 'ConsumedService'; valid values:

'ResourceGroup','ResourceGroupName','ResourceType','ResourceId','ResourceLocation','SubscriptionId','SubscriptionName','MeterCategory','MeterSubcategory','Meter','ServiceFamily','UnitOfMeasure','PartNumber','BillingAccountName','BillingProfileId','BillingProfileName','InvoiceSection','InvoiceSectionId','InvoiceSectionName','Product','ResourceGuid','ChargeType','ServiceName','ProductOrderId','ProductOrderName','PublisherType','ReservationId','ReservationName','Frequency','InvoiceId','PricingModel','CostAllocationRuleName','MarkupRuleName','BillingMonth','Provider','BenefitId','BenefitName','CustomerTenantId','CustomerTenantDomainName','ResellerMPNId','PartnerEarnedCreditApplied','CustomerName','PartnerName'

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cost Management - QueryAll issues in cost management associated with tags, dimensions and forecasts.MgmtThis issue is related to a management-plane library.Service AttentionWorkflow: 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.customer-reportedIssues 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 that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions