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=2019-10-01
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost?api-version=2019-10-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 2019-10-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

OK. The request has succeeded.

Other Status Codes

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=2019-10-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": "2019-10-01T00:00:00.0000000Z",
    "usageEnd": "2018-10-31T00: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": "2019-10-01T00:00:00.0000000Z",
          "usageEnd": "2018-10-31T00: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=2019-10-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

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.

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.

Name Type Description
error

The details of the error.

ManagementGroupAggregatedCostResult

A management group aggregated cost resource.

Name Type Description
id
  • string

Resource Id.

name
  • string

Resource name.

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

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.