你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Usage Details - List

列出定义的范围的使用情况详细信息。 使用情况详细信息仅适用于 2014 年 5 月 1 日或更高版本的此 API。

注意:Microsoft将在将来的某个时间点停用消耗使用情况详细信息 API。 不建议对此 API 采用新的依赖项。 请改用成本详细信息 API。 确定停用日期后,我们会通知客户。有关详细信息,请参阅 生成成本详细信息报表 - 创建作

GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&$expand={$expand}&$filter={$filter}&$skiptoken={$skiptoken}&$top={$top}&metric={metric}

URI 参数

名称 必需 类型 说明
scope
path True

string

资源的完全限定的 Azure 资源管理器标识符。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

$expand
query

string

可用于在使用情况详细信息列表中展开 properties/additionalInfo 或 properties/meterDetails。 默认情况下,列出使用情况详细信息时不包括这些字段。

$filter
query

string

可用于按 properties/resourceGroup、properties/resourceName、properties/resourceId、properties/resourceId、properties/chargeType、properties/reservationId、properties/reservationId、properties/publisherType 或标记筛选 usageDetails。 该筛选器支持“eq”、“lt”、“gt”、“le”、“ge”和“and”。 它当前不支持“ne”、“or”或“not”。 标记筛选器是键值对字符串,其中键和值由冒号分隔(:))。 PublisherType Filter 接受 Azure 和市场两个值,目前支持 Web Direct 产品/服务类型

$skiptoken
query

string

仅当以前的作返回了部分结果时,才使用 Skiptoken。 如果以前的响应包含 nextLink 元素,则 nextLink 元素的值将包含一个 skiptoken 参数,该参数指定用于后续调用的起点。

$top
query

integer (int32)

minimum: 1
maximum: 1000

可用于将结果数限制为最新的 N usageDetails。

metric
query

Metrictype

允许选择不同类型的成本/使用情况记录。

响应

名称 类型 说明
200 OK

UsageDetailsListResult

请求已成功。

204 No Content

作成功完成。

Other Status Codes

ErrorResponse

意外错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

BillingAccountUsageDetailsList-Legacy
BillingAccountUsageDetailsList-Modern
BillingAccountUsageDetailsListForBillingPeriod-Legacy
BillingProfileUsageDetailsList-Modern
CustomerUsageDetailsList-Modern
DepartmentUsageDetailsList-Legacy
DepartmentUsageDetailsListForBillingPeriod-Legacy
EnrollmentAccountUsageDetailsList-Legacy
EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy
InvoiceSectionUsageDetailsList-Modern
ManagementGroupUsageDetailsList-Legacy
ManagementGroupUsageDetailsListForBillingPeriod-Legacy
UsageDetailsExpand-Legacy
UsageDetailsList-Legacy
UsageDetailsListByMetricActualCost-Legacy
UsageDetailsListByMetricAmortizedCost-Legacy
UsageDetailsListByMetricUsage-Legacy
UsageDetailsListFilterByTag-Legacy
UsageDetailsListForBillingPeriod-Legacy

BillingAccountUsageDetailsList-Legacy

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000295194820065,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.000402776395232,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.7329,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

BillingAccountUsageDetailsList-Modern

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "modern",
      "properties": {
        "additionalInfo": "{  \"UsageType\": \"ComputeHR\",  \"ImageType\": \"Windows Client BYOL\",  \"ServiceType\": \"Standard_D1\",  \"VMName\": null,  \"VMProperties\": null,  \"VCPUs\": 1,  \"CPUs\": 0}",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "1234:56789",
        "billingAccountName": "Account Name 1",
        "billingCurrencyCode": "USD",
        "billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
        "billingProfileId": "2468",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "costCenter": "DEV",
        "costInBillingCurrency": 1.84763819095477,
        "costInPricingCurrency": 1.84763819095477,
        "costInUSD": 1.84763819095477,
        "customerName": "Modern Azure Customer 1",
        "customerTenantId": "00000000-0000-0000-0000-000000000000",
        "date": "2019-10-30T00:00:00.0000000Z",
        "exchangeRate": "1",
        "exchangeRateDate": "2019-09-30T00:00:00Z",
        "exchangeRatePricingToBilling": 0.077,
        "frequency": "UsageBased",
        "instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "invoiceId": "",
        "invoiceSectionId": "98765",
        "invoiceSectionName": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "marketPrice": 0.077,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "partnerEarnedCreditApplied": "0",
        "partnerEarnedCreditRate": 0.077,
        "partnerName": "Partner Name 1",
        "partnerTenantId": "00000000-0000-0000-0000-000000000000",
        "paygCostInBillingCurrency": 1.848,
        "paygCostInUSD": 1.848,
        "previousInvoiceId": "",
        "pricingCurrencyCode": "USD",
        "product": "Virtual Machines D Series - D1 - US East",
        "productIdentifier": "DZH318Z0BQ4B00FV",
        "productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
        "productOrderName": "Azure plan",
        "publisherId": "",
        "publisherName": "Microsoft",
        "publisherType": "Microsoft",
        "quantity": 0.7329,
        "resellerMpnId": "",
        "resellerName": "Reseller Name 1",
        "reservationId": "",
        "reservationName": "",
        "resourceGroup": "Resource Group 1",
        "resourceLocation": "USEast",
        "resourceLocationNormalized": "US East",
        "serviceInfo1": "",
        "serviceInfo2": "Windows Client BYOL",
        "servicePeriodEndDate": "2019-12-01T00:00:00Z",
        "servicePeriodStartDate": "2019-09-01T00:00:00Z",
        "subscriptionGuid": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "term": "",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

BillingAccountUsageDetailsListForBillingPeriod-Legacy

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010534556373432,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.74
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

BillingProfileUsageDetailsList-Modern

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "modern",
      "properties": {
        "additionalInfo": "{  \"UsageType\": \"ComputeHR\",  \"ImageType\": \"Windows Client BYOL\",  \"ServiceType\": \"Standard_D1\",  \"VMName\": null,  \"VMProperties\": null,  \"VCPUs\": 1,  \"CPUs\": 0}",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "1234:56789",
        "billingAccountName": "Account Name 1",
        "billingCurrencyCode": "USD",
        "billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
        "billingProfileId": "2468",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "costCenter": "DEV",
        "costInBillingCurrency": 1.84763819095477,
        "costInPricingCurrency": 1.84763819095477,
        "costInUSD": 1.84763819095477,
        "customerName": "Modern Azure Customer 1",
        "customerTenantId": "00000000-0000-0000-0000-000000000000",
        "date": "2019-10-30T00:00:00.0000000Z",
        "exchangeRate": "1",
        "exchangeRateDate": "2019-09-30T00:00:00Z",
        "exchangeRatePricingToBilling": 0.077,
        "frequency": "UsageBased",
        "instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "invoiceId": "",
        "invoiceSectionId": "98765",
        "invoiceSectionName": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "marketPrice": 0.077,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "partnerEarnedCreditApplied": "0",
        "partnerEarnedCreditRate": 0.077,
        "partnerName": "Partner Name 1",
        "partnerTenantId": "00000000-0000-0000-0000-000000000000",
        "paygCostInBillingCurrency": 1.848,
        "paygCostInUSD": 1.848,
        "previousInvoiceId": "",
        "pricingCurrencyCode": "USD",
        "product": "Virtual Machines D Series - D1 - US East",
        "productIdentifier": "DZH318Z0BQ4B00FV",
        "productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
        "productOrderName": "Azure plan",
        "publisherId": "",
        "publisherName": "Microsoft",
        "publisherType": "Microsoft",
        "quantity": 0.7329,
        "resellerMpnId": "",
        "resellerName": "Reseller Name 1",
        "reservationId": "",
        "reservationName": "",
        "resourceGroup": "Resource Group 1",
        "resourceLocation": "USEast",
        "resourceLocationNormalized": "US East",
        "serviceInfo1": "",
        "serviceInfo2": "Windows Client BYOL",
        "servicePeriodEndDate": "2019-12-01T00:00:00Z",
        "servicePeriodStartDate": "2019-09-01T00:00:00Z",
        "subscriptionGuid": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "term": "",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

CustomerUsageDetailsList-Modern

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "modern",
      "properties": {
        "additionalInfo": "{  \"UsageType\": \"ComputeHR\",  \"ImageType\": \"Windows Client BYOL\",  \"ServiceType\": \"Standard_D1\",  \"VMName\": null,  \"VMProperties\": null,  \"VCPUs\": 1,  \"CPUs\": 0}",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "1234:56789",
        "billingAccountName": "Account Name 1",
        "billingCurrencyCode": "USD",
        "billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
        "billingProfileId": "2468",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "costCenter": "DEV",
        "costInBillingCurrency": 1.84763819095477,
        "costInPricingCurrency": 1.84763819095477,
        "costInUSD": 1.84763819095477,
        "customerName": "Modern Azure Customer 1",
        "customerTenantId": "00000000-0000-0000-0000-000000000000",
        "date": "2019-10-30T00:00:00.0000000Z",
        "exchangeRate": "1",
        "exchangeRateDate": "2019-09-30T00:00:00Z",
        "exchangeRatePricingToBilling": 0.077,
        "frequency": "UsageBased",
        "instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "invoiceId": "",
        "invoiceSectionId": "98765",
        "invoiceSectionName": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "marketPrice": 0.077,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "partnerEarnedCreditApplied": "0",
        "partnerEarnedCreditRate": 0.077,
        "partnerName": "Partner Name 1",
        "partnerTenantId": "00000000-0000-0000-0000-000000000000",
        "paygCostInBillingCurrency": 1.848,
        "paygCostInUSD": 1.848,
        "previousInvoiceId": "",
        "pricingCurrencyCode": "USD",
        "product": "Virtual Machines D Series - D1 - US East",
        "productIdentifier": "DZH318Z0BQ4B00FV",
        "productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
        "productOrderName": "Azure plan",
        "publisherId": "",
        "publisherName": "Microsoft",
        "publisherType": "Microsoft",
        "quantity": 0.7329,
        "resellerMpnId": "",
        "resellerName": "Reseller Name 1",
        "reservationId": "",
        "reservationName": "",
        "resourceGroup": "Resource Group 1",
        "resourceLocation": "USEast",
        "resourceLocationNormalized": "US East",
        "serviceInfo1": "",
        "serviceInfo2": "Windows Client BYOL",
        "servicePeriodEndDate": "2019-12-01T00:00:00Z",
        "servicePeriodStartDate": "2019-09-01T00:00:00Z",
        "subscriptionGuid": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "term": "",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

DepartmentUsageDetailsList-Legacy

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000295194820065,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.000402776395232,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.7329,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

DepartmentUsageDetailsListForBillingPeriod-Legacy

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010534556373432,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.74
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

EnrollmentAccountUsageDetailsList-Legacy

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000295194820065,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.000402776395232,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.7329,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010534556373432,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.74
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

InvoiceSectionUsageDetailsList-Modern

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "modern",
      "properties": {
        "additionalInfo": "{  \"UsageType\": \"ComputeHR\",  \"ImageType\": \"Windows Client BYOL\",  \"ServiceType\": \"Standard_D1\",  \"VMName\": null,  \"VMProperties\": null,  \"VCPUs\": 1,  \"CPUs\": 0}",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "1234:56789",
        "billingAccountName": "Account Name 1",
        "billingCurrencyCode": "USD",
        "billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
        "billingProfileId": "2468",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "costCenter": "DEV",
        "costInBillingCurrency": 1.84763819095477,
        "costInPricingCurrency": 1.84763819095477,
        "costInUSD": 1.84763819095477,
        "customerName": "Modern Azure Customer 1",
        "customerTenantId": "00000000-0000-0000-0000-000000000000",
        "date": "2019-10-30T00:00:00.0000000Z",
        "exchangeRate": "1",
        "exchangeRateDate": "2019-09-30T00:00:00Z",
        "exchangeRatePricingToBilling": 0.077,
        "frequency": "UsageBased",
        "instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "invoiceId": "",
        "invoiceSectionId": "98765",
        "invoiceSectionName": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "marketPrice": 0.077,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "partnerEarnedCreditApplied": "0",
        "partnerEarnedCreditRate": 0.077,
        "partnerName": "Partner Name 1",
        "partnerTenantId": "00000000-0000-0000-0000-000000000000",
        "paygCostInBillingCurrency": 1.848,
        "paygCostInUSD": 1.848,
        "previousInvoiceId": "",
        "pricingCurrencyCode": "USD",
        "product": "Virtual Machines D Series - D1 - US East",
        "productIdentifier": "DZH318Z0BQ4B00FV",
        "productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
        "productOrderName": "Azure plan",
        "publisherId": "",
        "publisherName": "Microsoft",
        "publisherType": "Microsoft",
        "quantity": 0.7329,
        "resellerMpnId": "",
        "resellerName": "Reseller Name 1",
        "reservationId": "",
        "reservationName": "",
        "resourceGroup": "Resource Group 1",
        "resourceLocation": "USEast",
        "resourceLocationNormalized": "US East",
        "serviceInfo1": "",
        "serviceInfo2": "Windows Client BYOL",
        "servicePeriodEndDate": "2019-12-01T00:00:00Z",
        "servicePeriodStartDate": "2019-09-01T00:00:00Z",
        "subscriptionGuid": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "term": "",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

ManagementGroupUsageDetailsList-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010534556373432,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.74
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    },
    {
      "name": "usageDetails_Id2",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/scope/providers/Microsoft.Billing/billingPeriods/20180801/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 2",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 2",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000295194820065,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.000402776395232,
        "invoiceSection": "Invoice Section 2",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "11111111-1111-1111-1111-111111111111",
        "offerId": "Offer Id 2",
        "partNumber": "Part Number 2",
        "product": "Product Name 2",
        "quantity": 0.7329,
        "resourceGroup": "Resource Group 2",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 2",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 4.38
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

ManagementGroupUsageDetailsListForBillingPeriod-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010534556373432,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.74
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    },
    {
      "name": "usageDetails_Id2",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/scope/providers/Microsoft.Billing/billingPeriods/billingPeriodName/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 2",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 2",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 2",
        "chargeType": "UnusedReservation",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000821821271948,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.073488920944598,
        "invoiceSection": "Invoice Section 2",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "11111111-1111-1111-1111-111111111111",
        "offerId": "Offer Id 2",
        "partNumber": "Part Number 2",
        "product": "Product Name 2",
        "quantity": 0.4759,
        "resourceGroup": "Resource Group 2",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 2",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 2",
        "unitPrice": 5.74
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

UsageDetailsExpand-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&$expand=meterDetails,additionalInfo&$filter=tags eq 'dev:tools'&$top=1

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "additionalInfo": "{\"MyType\":\"\",\"ServiceType\":\"\",\"VMName\":\"\",\"UsageType\":\"MyUsage\"}",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010464556322455,
        "frequency": "UsageBased",
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": {
          "meterCategory": "Networking",
          "meterName": "Data Transfer Out (GB)",
          "meterSubCategory": "ExpressRoute",
          "serviceFamily": "Compute",
          "unitOfMeasure": "GB"
        },
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.54
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

UsageDetailsList-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "AccountName",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Customer Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Customer Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.ClassicStorage",
        "cost": 1.980949998E-06,
        "costCenter": "BAS",
        "date": "2019-04-09T00:00:00.0000000Z",
        "effectivePrice": 0.054693034210767,
        "frequency": "UsageBased",
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product1",
        "quantity": 3.6E-05,
        "resourceGroup": "Resource-Group-westus",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
        "resourceLocation": "uswest",
        "resourceName": "ResourceName1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "SubscriptionName 1",
        "unitPrice": 5.47
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

UsageDetailsListByMetricActualCost-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=actualcost

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "AccountName",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Customer Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Customer Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.ClassicStorage",
        "cost": 1.968949998E-06,
        "costCenter": "BAS",
        "date": "2019-04-09T00:00:00.0000000Z",
        "effectivePrice": 0.054693055510767,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product1",
        "quantity": 3.6E-05,
        "resourceGroup": "Resource-Group-westus",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
        "resourceLocation": "uswest",
        "resourceName": "ResourceName1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "SubscriptionName 1",
        "unitPrice": 5.47
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

UsageDetailsListByMetricAmortizedCost-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=amortizedcost

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "AccountName",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Customer Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Customer Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.ClassicStorage",
        "cost": 1.968949998E-06,
        "costCenter": "BAS",
        "date": "2019-04-09T00:00:00.0000000Z",
        "effectivePrice": 0.054693055510767,
        "frequency": "UsageBased",
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product1",
        "quantity": 3.6E-05,
        "resourceGroup": "Resource-Group-westus",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
        "resourceLocation": "uswest",
        "resourceName": "ResourceName1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "SubscriptionName 1",
        "unitPrice": 5.47
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

UsageDetailsListByMetricUsage-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=usage

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "AccountName",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Customer Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Customer Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.ClassicStorage",
        "cost": 1.968949998E-06,
        "costCenter": "BAS",
        "date": "2019-04-09T00:00:00.0000000Z",
        "effectivePrice": 0.054693055510767,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product1",
        "quantity": 3.6E-05,
        "resourceGroup": "Resource-Group-westus",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
        "resourceLocation": "uswest",
        "resourceName": "ResourceName1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "SubscriptionName 1",
        "unitPrice": 5.47
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

UsageDetailsListFilterByTag-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&$filter=tags eq 'dev:tools'

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010534556373432,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.74
      },
      "tags": {
        "dev": "tools"
      }
    }
  ]
}

UsageDetailsListForBillingPeriod-Legacy

示例请求

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01

示例响应

{
  "value": [
    {
      "name": "usageDetails_Id1",
      "type": "Microsoft.Consumption/usageDetails",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
      "kind": "legacy",
      "properties": {
        "accountName": "Account Name 1",
        "benefitId": "00000000-0000-0000-0000-000000000000",
        "benefitName": "Reservation_purchase_03-09-2018_10-59",
        "billingAccountId": "xxxxxxxx",
        "billingAccountName": "Account Name 1",
        "billingCurrency": "CAD",
        "billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
        "billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
        "billingProfileId": "xxxxxxxx",
        "billingProfileName": "Account Name 1",
        "chargeType": "Usage",
        "consumedService": "Microsoft.Storage",
        "cost": 0.000342194841184,
        "costCenter": "DEV",
        "date": "2019-03-30T00:00:00.0000000Z",
        "effectivePrice": 0.010534556373432,
        "invoiceSection": "Invoice Section 1",
        "isAzureCreditEligible": false,
        "meterDetails": null,
        "meterId": "00000000-0000-0000-0000-000000000000",
        "offerId": "Offer Id 1",
        "partNumber": "Part Number 1",
        "product": "Product Name 1",
        "quantity": 0.8234,
        "resourceGroup": "Resource Group 1",
        "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
        "resourceLocation": "USEast",
        "resourceName": "Resource Name 1",
        "subscriptionId": "00000000-0000-0000-0000-000000000000",
        "subscriptionName": "Subscription Name 1",
        "unitPrice": 3.74
      },
      "tags": {
        "dev": "tools",
        "env": "newcrp"
      }
    }
  ]
}

定义

名称 说明
createdByType

创建资源的标识的类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

LegacyUsageDetail

旧版使用情况详细信息。

MeterDetailsResponse

计量详细信息的属性。

Metrictype
ModernUsageDetail

新式用法详细信息。

PricingModelType

指示计量器定价方式的标识符。

systemData

与创建和上次修改资源相关的元数据。

UsageDetailsKind

指定使用情况详细信息的类型。

UsageDetailsListResult

列出使用情况详细信息的结果。 它包含按计费周期按时间顺序排列的可用使用情况详细信息列表。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

LegacyUsageDetail

旧版使用情况详细信息。

名称 类型 说明
etag

string

资源的 etag。

id

string

资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

kind string:

legacy

指定使用情况详细信息的类型。

name

string

资源的名称

properties.accountName

string

帐户名称。

properties.accountOwnerId

string

帐户所有者 ID。

properties.additionalInfo

string

此使用项的其他详细信息。 默认情况下,除非在$expand中指定,否则不会填充它。 使用此字段可获取使用情况行项特定详细信息,例如实际 VM 大小(ServiceType)或应用预留折扣的比例。

properties.benefitId

string

适用权益的唯一标识符。

properties.benefitName

string

适用权益的名称。

properties.billingAccountId

string

计费帐户标识符。

properties.billingAccountName

string

计费帐户名称。

properties.billingCurrency

string

计费货币。

properties.billingPeriodEndDate

string (date-time)

计费周期结束日期。

properties.billingPeriodStartDate

string (date-time)

计费周期开始日期。

properties.billingProfileId

string

计费配置文件标识符。

properties.billingProfileName

string

计费配置文件名称。

properties.chargeType

string

指示费用表示额度、使用情况、市场购买、预留费或退款。

properties.consumedService

string

已使用的服务名称。 发出使用情况或购买的 Azure 资源提供程序的名称。 未为市场使用情况提供此值。

properties.cost

number (decimal)

税前的成本金额。

properties.costCenter

string

如果此部门是部门和成本中心,则此部门的成本中心。

properties.date

string (date-time)

使用情况记录的日期。

properties.effectivePrice

number (decimal)

使用费的有效价格。

properties.frequency

string

指示此费用的发生频率。 OneTime 用于仅发生一次的购买、每月递归的费用,以及基于服务使用的费用的 UsageBased。

properties.invoiceSection

string

发票科目名称。

properties.isAzureCreditEligible

boolean

符合 Azure 额度条件。

properties.meterDetails

MeterDetailsResponse

有关计量的详细信息。 默认情况下,除非在$expand中指定,否则不会填充它。

properties.meterId

string (uuid)

计量 ID (GUID)。 不适用于市场。 对于预留实例,这表示为其购买预留的主要计量。 有关购买预留的实际 VM 大小,请参阅 productOrderName。

properties.offerId

string

产品/服务 ID。例如:MS-AZR-0017P、MS-AZR-0148P。

properties.partNumber

string

使用的服务的部件号。 可用于与价目表联接。 不适用于市场。

properties.payGPrice

number (decimal)

资源的零售价格。

properties.planName

string

计划名称。

properties.pricingModel

PricingModelType

指示计量器定价方式的标识符。

properties.product

string

已使用服务或购买的产品名称。 不适用于市场。

properties.productOrderId

string

产品订单 ID。对于预留,这是预留订单 ID。

properties.productOrderName

string

产品名称。 对于预留,这是购买的 SKU。

properties.publisherName

string

发布者名称。

properties.publisherType

string

发布服务器类型。

properties.quantity

number (decimal)

使用数量。

properties.reservationId

string

预留的 ARM 资源 ID。 仅适用于与预留相关的记录。

properties.reservationName

string

用户提供的预留的显示名称。 特定日期的姓氏在每日数据中填充。 仅适用于与预留相关的记录。

properties.resourceGroup

string

资源组名称。

properties.resourceId

string

Azure 资源管理器使用情况详细信息资源的唯一标识符。

properties.resourceLocation

string

资源位置。

properties.resourceName

string

资源名称。

properties.serviceInfo1

string

服务特定的元数据。

properties.serviceInfo2

string

旧字段,具有可选的特定于服务的元数据。

properties.subscriptionId

string

订阅 guid。

properties.subscriptionName

string

订阅名称。

properties.term

string

术语(以月为单位)。 每月定期购买的 1 个月。 12 个月预订 1 年。 36 个月预订 3 年。

properties.unitPrice

number (decimal)

单价是适用于你的价格。 (你的 EA 或其他合同价格)。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

tags

object

资源标记。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

MeterDetailsResponse

计量详细信息的属性。

名称 类型 说明
meterCategory

string

计量的类别,例如“云服务”、“网络”等。

meterName

string

给定计量类别中的计量名称

meterSubCategory

string

计量的子类别,例如“A6 云服务”、“ExpressRoute (IXP)”等。

serviceFamily

string

服务系列。

unitOfMeasure

string

计量消耗费用的单位,例如“小时”、“GB”等。

Metrictype

说明
actualcost

实际成本数据。

amortizedcost

摊销成本数据。

usage

使用情况数据。

ModernUsageDetail

新式用法详细信息。

名称 类型 说明
etag

string

资源的 etag。

id

string

资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

kind string:

modern

指定使用情况详细信息的类型。

name

string

资源的名称

properties.additionalInfo

string

此使用项的其他详细信息。 使用此字段可获取使用情况行项特定详细信息,例如实际 VM 大小(ServiceType)或应用预留折扣的比例。

properties.benefitId

string

适用权益的唯一标识符。

properties.benefitName

string

适用权益的名称。

properties.billingAccountId

string

计费帐户标识符。

properties.billingAccountName

string

计费帐户的名称。

properties.billingCurrencyCode

string

定义计费成本的货币。

properties.billingPeriodEndDate

string (date-time)

发票中所示的计费周期结束日期。

properties.billingPeriodStartDate

string (date-time)

发票中的计费周期开始日期。

properties.billingProfileId

string

计费配置文件的标识符,该配置文件按单一计费货币对已加入Microsoft客户协议的客户和 CSP 中已进行权利购买的客户(如 SaaS、市场、RI 等)的成本进行分组。

properties.billingProfileName

string

按单一计费货币将发票的成本分组到已加入Microsoft客户协议的客户和 CSP 中已进行权利购买的客户(如 SaaS、市场、RI 等)的计费配置文件的名称。

properties.chargeType

string

指示费用表示额度、使用情况、市场购买、预留费或退款。

properties.consumedService

string

已使用的服务名称。 发出使用情况或购买的 Azure 资源提供程序的名称。 未为市场使用情况提供此值。

properties.costAllocationRuleName

string

成本分配规则的名称。

properties.costCenter

string

如果此部门是部门和成本中心,则此部门的成本中心。

properties.costInBillingCurrency

number (decimal)

在按计费货币征税之前,ExtendedCost 或混合成本。

properties.costInPricingCurrency

number (decimal)

与价格关联的采用定价货币的 ExtendedCost 或混合税前成本。

properties.costInUSD

number (decimal)

估计的延长成本或混合成本之前,税前为美元。

properties.customerName

string

客户的 AAD 租户的名称。

properties.customerTenantId

string

客户的 AAD 租户的标识符。

properties.date

string (date-time)

使用情况记录的日期。

properties.effectivePrice

number (decimal)

使用费的有效价格。

properties.exchangeRate

string

从定价货币转换为计费货币的汇率。

properties.exchangeRateDate

string (date-time)

从定价货币转换为计费货币的汇率的日期。

properties.exchangeRatePricingToBilling

number (decimal)

从定价货币到计费货币的汇率。

properties.frequency

string

指示此费用的发生频率。 OneTime 用于仅发生一次的购买、每月递归的费用,以及基于服务使用的费用的 UsageBased。

properties.instanceName

string

实例名称。

properties.invoiceId

string

发票 ID,如显示特定交易的发票上所示。

properties.invoiceSectionId

string

在发票中计费的项目的标识符。 不适用于合作伙伴加入的 Microsoft 客户协议。

properties.invoiceSectionName

string

在发票中计费的项目的名称。 不适用于合作伙伴加入的 Microsoft 客户协议。

properties.isAzureCreditEligible

boolean

确定成本是否符合使用 Azure 额度付费的条件。

properties.marketPrice

number (decimal)

按使用量收费的市场价格。

properties.meterCategory

string

标识使用情况的顶级服务。

properties.meterId

string (uuid)

计量 ID (GUID)。 不适用于市场。 对于预留实例,这表示为其购买预留的主要计量。 有关购买预留的实际 VM 大小,请参阅 productOrderName。

properties.meterName

string

标识度量消耗量所针对的计量的名称。

properties.meterRegion

string

指明某些服务的数据中心的位置,这些服务根据数据中心位置进行定价。

properties.meterSubCategory

string

定义可能影响速率的 Azure 服务的类型或子类别。

properties.partnerEarnedCreditApplied

string

指示是否已应用合作伙伴赚取的返点的标志。

properties.partnerEarnedCreditRate

number (decimal)

如果合作伙伴赚取的额度(PEC)基于合作伙伴管理员链接访问权限,则应用的折扣率。

properties.partnerName

string

合作伙伴的 AAD 租户的名称。

properties.partnerTenantId

string

合作伙伴 AAD 租户的标识符。

properties.payGPrice

number (decimal)

资源的零售价格。

properties.paygCostInBillingCurrency

number (decimal)

以计费货币计税前的 PayG 成本金额。

properties.paygCostInUSD

number (decimal)

以美元货币计税前的 PayG 成本金额。

properties.previousInvoiceId

string

对原始发票的引用存在退款(负成本)。 仅当存在退款时,才会填充此项。

properties.pricingCurrencyCode

string

定价计费货币。

properties.pricingModel

PricingModelType

指示计量定价方式的标识符

properties.product

string

按发票中列出的消费或购买产生费用的产品的名称。 不适用于市场。

properties.productIdentifier

string

按消耗或购买产生费用的产品的标识符。 这是合作伙伴中心 productId 和 SkuId 的串联密钥。

properties.productOrderId

string

订阅所属的资产或 Azure 计划名称的标识符。 例如:Azure 计划。 对于预留,这是预留订单 ID。

properties.productOrderName

string

产品名称。 对于预留,这是购买的 SKU。

properties.provider

string

产品类别或业务线的标识符,例如 - Azure,Microsoft 365,AWS e.t.c

properties.publisherId

string

发布者 ID。

properties.publisherName

string

服务发布者的名称,包括Microsoft或第三方发布者。

properties.publisherType

string

标识发布者是否是第一方、第三方经销商或第三方代理的发布者类型。

properties.quantity

number (decimal)

测量购买或消耗的数量。计费期间使用的计量量。

properties.resellerMpnId

string

与订阅关联的经销商的 MPNId。

properties.resellerName

string

经销商名称。

properties.reservationId

string

预留的 ARM 资源 ID。 仅适用于与预留相关的记录。

properties.reservationName

string

用户提供的预留的显示名称。 特定日期的姓氏在每日数据中填充。 仅适用于与预留相关的记录。

properties.resourceGroup

string

用于资源统一生命周期管理的 Azure 资源组的名称。

properties.resourceLocation

string

资源位置的名称。

properties.resourceLocationNormalized

string

资源位置规范化。

properties.serviceFamily

string

列出购买或收费的产品的服务系列(示例:存储;计算)。

properties.serviceInfo1

string

服务特定的元数据。

properties.serviceInfo2

string

旧字段,具有可选的特定于服务的元数据。

properties.servicePeriodEndDate

string (date-time)

为服务用量分级费用时的时段结束日期。 将根据分级时段确定 Azure 服务的价格。

properties.servicePeriodStartDate

string (date-time)

为服务用量分级费用时分级时段的开始日期。 将根据分级时段确定 Azure 服务的价格。

properties.subscriptionGuid

string

Azure 订阅的唯一Microsoft生成的标识符。

properties.subscriptionName

string

Azure 订阅的名称。

properties.term

string

术语(以月为单位)。 显示套餐的有效期限。 例如。 对于预留实例,它显示预留实例的每年期限为 12 个月。 对于一次性购买或定期购买,条款显示 1 个月;这不适用于 Azure 消耗。

properties.unitOfMeasure

string

标识服务按其计费的单位。 例如,GB、小时、10,000 秒。

properties.unitPrice

number (decimal)

单价是适用于你的价格。 (你的 EA 或其他合同价格)。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

tags

object

资源标记。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

PricingModelType

指示计量器定价方式的标识符。

说明
On Demand
Reservation
Spot

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

UsageDetailsKind

指定使用情况详细信息的类型。

说明
legacy
modern

UsageDetailsListResult

列出使用情况详细信息的结果。 它包含按计费周期按时间顺序排列的可用使用情况详细信息列表。

名称 类型 说明
nextLink

string

指向下一页结果的链接(url)。

value UsageDetail[]:

使用情况详细信息的列表。