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

Order Id of the reservation

api-version
query True

string

minLength: 1

The API version to use for this operation.

$filter
query

string

Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'

Responses

Name Type Description
200 OK

ManagementGroupAggregatedCostResult

The request has succeeded.

Other Status Codes

ErrorResponse

An unexpected error response.

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

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

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

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

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ManagementGroupAggregatedCostResult

A management group aggregated cost resource.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ManagementGroupAggregatedCostResult

A management group aggregated cost resource.

Name Type Description
etag

string

The etag for the resource.

id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties.azureCharges

number (decimal)

Azure Charges.

properties.billingPeriodId

string

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

properties.chargesBilledSeparately

number (decimal)

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 (decimal)

Marketplace Charges.

properties.usageEnd

string (date-time)

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

properties.usageStart

string (date-time)

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

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

tags

object

Resource tags.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.