Aggregated Cost - Get By Management Group

Provides the aggregate cost of a management group and all child management groups by current billing period.

GET https://management.azure.com/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost?api-version=2024-08-01
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost?api-version=2024-08-01&$filter={$filter}

URI Parameters

Name In Required Type Description
managementGroupId
path True

string

Azure Management Group ID.

api-version
query True

string

Version of the API to be used with the client request. The current version is 2023-03-01.

$filter
query

string

May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).

Responses

Name Type Description
200 OK

ManagementGroupAggregatedCostResult

OK. The request has succeeded.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

AggregatedCostByManagementGroup
AggregatedCostByManagementGroupFilterByDate

AggregatedCostByManagementGroup

Sample request

GET https://management.azure.com/providers/Microsoft.Management/managementGroups/managementGroupForTest/providers/Microsoft.Consumption/aggregatedcost?api-version=2024-08-01

Sample response

{
  "id": "/providers/Microsoft.Management/managementGroups/managementGroupForTest/providers/Microsoft.Consumption/aggregatedcostId1",
  "name": "aggregatedcostId1",
  "type": "Microsoft.Consumption/aggregatedcost",
  "properties": {
    "includedSubscriptions": [
      "1caaa5a3-2b66-438e-8ab4-bce37d518c5d"
    ],
    "excludedSubscriptions": [],
    "usageStart": "2023-03-01T00:00:00.0000000Z",
    "usageEnd": "2024-08-01T00:00:00.0000000Z",
    "azureCharges": 250.9876,
    "marketplaceCharges": 150.786,
    "chargesBilledSeparately": 120.345,
    "currency": "USD",
    "children": [
      {
        "id": "/providers/Microsoft.Management/managementGroups/managementGroupChildForTest/providers/Microsoft.Consumption/aggregatedcostId2",
        "name": "aggregatedcostId2",
        "type": "Microsoft.Consumption/aggregatedcost",
        "properties": {
          "includedSubscriptions": [
            "c349567d-c83a-48c9-ab0e-578c69dc97a4"
          ],
          "excludedSubscriptions": [],
          "usageStart": "2023-03-01T00:00:00.0000000Z",
          "usageEnd": "2024-08-01T00:00:00.0000000Z",
          "azureCharges": 150,
          "marketplaceCharges": 50.786,
          "chargesBilledSeparately": 30.345,
          "currency": "USD",
          "children": []
        }
      }
    ]
  }
}

AggregatedCostByManagementGroupFilterByDate

Sample request

GET https://management.azure.com/providers/Microsoft.Management/managementGroups/managementGroupForTest/providers/Microsoft.Consumption/aggregatedcost?api-version=2024-08-01&$filter=usageStart ge '2018-08-15' and properties/usageStart le '2018-08-31'

Sample response

{
  "id": "/providers/Microsoft.Management/managementGroups/managementGroupForTest/providers/Microsoft.Consumption/aggregatedcostId1",
  "name": "aggregatedcostId1",
  "type": "Microsoft.Consumption/aggregatedcost",
  "properties": {
    "includedSubscriptions": [
      "1caaa5a3-2b66-438e-8ab4-bce37d518c5d"
    ],
    "excludedSubscriptions": [],
    "usageStart": "2018-08-15T00:00:00.0000000Z",
    "usageEnd": "2018-08-31T00:00:00.0000000Z",
    "azureCharges": 150.9876,
    "marketplaceCharges": 80.786,
    "chargesBilledSeparately": 90.345,
    "currency": "USD",
    "children": [
      {
        "id": "/providers/Microsoft.Management/managementGroups/managementGroupChildForTest/providers/Microsoft.Consumption/aggregatedcostId2",
        "name": "aggregatedcostId2",
        "type": "Microsoft.Consumption/aggregatedcost",
        "properties": {
          "includedSubscriptions": [
            "c349567d-c83a-48c9-ab0e-578c69dc97a4"
          ],
          "excludedSubscriptions": [],
          "usageStart": "2018-08-15T00:00:00.0000000Z",
          "usageEnd": "2018-08-31T00:00:00.0000000Z",
          "azureCharges": 50,
          "marketplaceCharges": 10.786,
          "chargesBilledSeparately": 30.345,
          "currency": "USD",
          "children": []
        }
      }
    ]
  }
}

Definitions

Name Description
ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

  • 504 Gateway Timeout - Service timed out while processing the request. Reduce the date range in the request, if possible.

ManagementGroupAggregatedCostResult

A management group aggregated cost resource.

ErrorDetails

The details of the error.

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

  • 504 Gateway Timeout - Service timed out while processing the request. Reduce the date range in the request, if possible.

Name Type Description
error

ErrorDetails

The details of the error.

ManagementGroupAggregatedCostResult

A management group aggregated cost resource.

Name Type Description
etag

string

The etag for the resource.

id

string

The full qualified ARM ID of an event.

name

string

The ID that uniquely identifies an event.

properties.azureCharges

number

Azure Charges.

properties.billingPeriodId

string

The id of the billing period resource that the aggregated cost belongs to.

properties.chargesBilledSeparately

number

Charges Billed Separately.

properties.children

ManagementGroupAggregatedCostResult[]

Children of a management group

properties.currency

string

The ISO currency in which the meter is charged, for example, USD.

properties.excludedSubscriptions

string[]

List of subscription Guids excluded from the calculation of aggregated cost

properties.includedSubscriptions

string[]

List of subscription Guids included in the calculation of aggregated cost

properties.marketplaceCharges

number

Marketplace Charges.

properties.usageEnd

string

The end of the date time range covered by the aggregated cost.

properties.usageStart

string

The start of the date time range covered by aggregated cost.

tags

object

Resource tags.

type

string

Resource type.