API request to CostManagment with grouping by Resources RRS feed

  • Question

  • Hello, 

    We have some trouble with API request in Cost Management - Cost analysis. Via web panel we're able to make report with "Cost by resource" and Group by "Resource", but via API we can make request only with "ResourseType"  or "ServiceName".

    Request JSON:
     "type": "Usage",
     "timeframe": "TheLastMonth",
      "dataset": {
        "granularity": "Monthly",
        "aggregation": {
          "totalCost": {
            "name": "PreTaxCost",
            "function": "Sum"
        "grouping": [
            "type": "Dimension",
            "name": "ResourceType"
        "sorting": [
            "name": "ResourceType",
            "direction": "Descending"

    I've read https://docs.microsoft.com/en-us/rest/api/cost-management/query/usagebyscoper several times, but with no luck.
    Is there any chance this functionality will be present in future?

    Wednesday, March 20, 2019 5:12 AM

All replies