你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Usage Details - List
Lists定义的范围的使用情况详细信息。 使用情况详细信息仅在 2014 年 5 月 1 日或更高版本通过此 API 提供。
注意:Microsoft 将在将来的某个时候停用消耗使用情况详细信息 API。 建议不要对此 API 采用新的依赖项。 请改用成本详细信息 API。 确定停用日期后,我们会通知客户。有关详细信息,请参阅 生成成本详细信息报表 - 创建操作
GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?$expand={$expand}&$filter={$filter}&$skiptoken={$skiptoken}&$top={$top}&api-version=2023-05-01&metric={metric}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
scope
|
path | True |
string |
与使用情况详细信息操作关联的范围。 这包括订阅范围的“/subscriptions/{subscriptionId}/” “/providers/Microsoft.Billing/billingAccounts/{billingAccountId}”表示计费帐户范围,“/providers/Microsoft.Billing/departments/{departmentId}”表示部门范围,“/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}”表示“注册帐户”范围,“/providers/Microsoft.Management/managementGroups/{managementGroupId}”表示管理组范围。 对于订阅、计费帐户、部门、注册帐户和管理组,还可以使用“/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}”将计费周期添加到范围。 例如,若要在部门范围内指定计费周期,请使用“/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}”。 此外,对于 billingAccount 范围,现代商务帐户范围为“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}” “/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}”表示 billingProfile 范围,“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}”表示 invoiceSection 范围,以及“/providers/Microsoft”。特定于合作伙伴的 Billing/billingAccounts/{billingAccountId}/customers/{customerId}。 |
api-version
|
query | True |
string |
要与客户端请求一起使用的 API 的版本。 当前版本为 2023-03-01。 |
$expand
|
query |
string |
可用于在使用情况详细信息列表中展开 properties/additionalInfo 或 properties/meterDetails。 默认情况下,列出使用情况详细信息时不包括这些字段。 |
|
$filter
|
query |
string |
可用于按 properties/resourceGroup、properties/resourceName、properties/resourceId、properties/chargeType、properties/reservationId、properties/publisherType 或 tags 筛选 usageDetails。 筛选器支持“eq”、“lt”、“gt”、“le”、“ge”和“and”。 它当前不支持“ne”、“or”或“not”。 标记筛选器是键值对字符串,其中键和值用冒号 (:) 分隔。 PublisherType 筛选器接受 azure 和 marketplace 两个值,并且 Web Direct 产品/服务类型目前支持它 |
|
$skiptoken
|
query |
string |
仅当上一个操作返回部分结果时,才使用 Skiptoken。 如果上一个响应包含 nextLink 元素,则 nextLink 元素的值将包含一个 skiptoken 参数,该参数指定用于后续调用的起点。 |
|
$top
|
query |
integer int32 |
可用于将结果数限制为最近的 N usageDetails。 |
|
metric
|
query |
允许选择不同类型的成本/使用情况记录。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
没问题。 请求已成功。 |
|
204 No Content |
无内容。 请求已成功,但未返回任何结果。 |
|
Other Status Codes |
描述操作失败原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
BillingAccountUsageDetailsList-Legacy
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.7329,
"effectivePrice": 0.000402776395232,
"cost": 0.000295194820065,
"unitPrice": 4.38,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
BillingAccountUsageDetailsList-Modern
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "modern",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-10-30T00:00:00.0000000Z",
"meterId": "00000000-0000-0000-0000-000000000000",
"quantity": 0.7329,
"unitPrice": 4.38,
"billingCurrencyCode": "USD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"invoiceId": "",
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"customerName": "Modern Azure Customer 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"partnerName": "Partner Name 1",
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"publisherId": "",
"reservationId": "",
"reservationName": "",
"frequency": "UsageBased",
"term": "",
"marketPrice": 0.077,
"costInUSD": 1.84763819095477,
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"exchangeRatePricingToBilling": 0.077,
"partnerEarnedCreditRate": 0.077,
"partnerEarnedCreditApplied": "0",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
BillingAccountUsageDetailsListForBillingPeriod-Legacy
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.8234,
"effectivePrice": 0.010534556373432,
"cost": 0.000342194841184,
"unitPrice": 3.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
BillingProfileUsageDetailsList-Modern
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "modern",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-10-30T00:00:00.0000000Z",
"meterId": "00000000-0000-0000-0000-000000000000",
"quantity": 0.7329,
"unitPrice": 4.38,
"billingCurrencyCode": "USD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"invoiceId": "",
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"customerName": "Modern Azure Customer 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"partnerName": "Partner Name 1",
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"publisherId": "",
"reservationId": "",
"reservationName": "",
"frequency": "UsageBased",
"term": "",
"marketPrice": 0.077,
"costInUSD": 1.84763819095477,
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"exchangeRatePricingToBilling": 0.077,
"partnerEarnedCreditRate": 0.077,
"partnerEarnedCreditApplied": "0",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
CustomerUsageDetailsList-Modern
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "modern",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-10-30T00:00:00.0000000Z",
"meterId": "00000000-0000-0000-0000-000000000000",
"quantity": 0.7329,
"unitPrice": 4.38,
"billingCurrencyCode": "USD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"invoiceId": "",
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"customerName": "Modern Azure Customer 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"partnerName": "Partner Name 1",
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"publisherId": "",
"reservationId": "",
"reservationName": "",
"frequency": "UsageBased",
"term": "",
"marketPrice": 0.077,
"costInUSD": 1.84763819095477,
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"exchangeRatePricingToBilling": 0.077,
"partnerEarnedCreditRate": 0.077,
"partnerEarnedCreditApplied": "0",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
DepartmentUsageDetailsList-Legacy
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.7329,
"effectivePrice": 0.000402776395232,
"cost": 0.000295194820065,
"unitPrice": 4.38,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
DepartmentUsageDetailsListForBillingPeriod-Legacy
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.8234,
"effectivePrice": 0.010534556373432,
"cost": 0.000342194841184,
"unitPrice": 3.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
EnrollmentAccountUsageDetailsList-Legacy
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.7329,
"effectivePrice": 0.000402776395232,
"cost": 0.000295194820065,
"unitPrice": 4.38,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.8234,
"effectivePrice": 0.010534556373432,
"cost": 0.000342194841184,
"unitPrice": 3.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
InvoiceSectionUsageDetailsList-Modern
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "modern",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "1234:56789",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-09-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-10-31T00:00:00.0000000Z",
"billingProfileId": "2468",
"billingProfileName": "Account Name 1",
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-10-30T00:00:00.0000000Z",
"meterId": "00000000-0000-0000-0000-000000000000",
"quantity": 0.7329,
"unitPrice": 4.38,
"billingCurrencyCode": "USD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"instanceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"invoiceSectionId": "98765",
"invoiceSectionName": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"additionalInfo": "{ \"UsageType\": \"ComputeHR\", \"ImageType\": \"Windows Client BYOL\", \"ServiceType\": \"Standard_D1\", \"VMName\": null, \"VMProperties\": null, \"VCPUs\": 1, \"CPUs\": 0}",
"costInBillingCurrency": 1.84763819095477,
"costInPricingCurrency": 1.84763819095477,
"exchangeRate": "1",
"exchangeRateDate": "2019-09-30T00:00:00Z",
"invoiceId": "",
"previousInvoiceId": "",
"pricingCurrencyCode": "USD",
"product": "Virtual Machines D Series - D1 - US East",
"productIdentifier": "DZH318Z0BQ4B00FV",
"productOrderId": "a3db7880-70eb-4b4c-6a79-1425a058df5a",
"productOrderName": "Azure plan",
"publisherName": "Microsoft",
"publisherType": "Microsoft",
"resourceLocationNormalized": "US East",
"serviceInfo1": "",
"serviceInfo2": "Windows Client BYOL",
"servicePeriodEndDate": "2019-12-01T00:00:00Z",
"servicePeriodStartDate": "2019-09-01T00:00:00Z",
"customerTenantId": "00000000-0000-0000-0000-000000000000",
"customerName": "Modern Azure Customer 1",
"partnerTenantId": "00000000-0000-0000-0000-000000000000",
"partnerName": "Partner Name 1",
"resellerMpnId": "",
"resellerName": "Reseller Name 1",
"publisherId": "",
"reservationId": "",
"reservationName": "",
"frequency": "UsageBased",
"term": "",
"marketPrice": 0.077,
"costInUSD": 1.84763819095477,
"paygCostInBillingCurrency": 1.848,
"paygCostInUSD": 1.848,
"exchangeRatePricingToBilling": 0.077,
"partnerEarnedCreditRate": 0.077,
"partnerEarnedCreditApplied": "0",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
ManagementGroupUsageDetailsList-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.8234,
"effectivePrice": 0.010534556373432,
"cost": 0.000342194841184,
"unitPrice": 3.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
},
{
"id": "/scope/providers/Microsoft.Billing/billingPeriods/20180801/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2",
"name": "usageDetails_Id2",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 2",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 2",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 2",
"partNumber": "Part Number 2",
"meterId": "11111111-1111-1111-1111-111111111111",
"meterDetails": null,
"quantity": 0.7329,
"effectivePrice": 0.000402776395232,
"cost": 0.000295194820065,
"unitPrice": 4.38,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2",
"resourceName": "Resource Name 2",
"invoiceSection": "Invoice Section 2",
"costCenter": "DEV",
"resourceGroup": "Resource Group 2",
"offerId": "Offer Id 2",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
ManagementGroupUsageDetailsListForBillingPeriod-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.8234,
"effectivePrice": 0.010534556373432,
"cost": 0.000342194841184,
"unitPrice": 3.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
},
{
"id": "/scope/providers/Microsoft.Billing/billingPeriods/billingPeriodName/providers/Microsoft.Consumption/usageDetails/usageDetails_Id2",
"name": "usageDetails_Id2",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 2",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 2",
"accountName": "Account Name 2",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 2",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 2",
"partNumber": "Part Number 2",
"meterId": "11111111-1111-1111-1111-111111111111",
"meterDetails": null,
"quantity": 0.4759,
"effectivePrice": 0.073488920944598,
"cost": 0.000821821271948,
"unitPrice": 5.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 2/providers/Microsoft.Storage/storageAccounts/Resource Name 2",
"resourceName": "Resource Name 2",
"invoiceSection": "Invoice Section 2",
"costCenter": "DEV",
"resourceGroup": "Resource Group 2",
"offerId": "Offer Id 2",
"isAzureCreditEligible": false,
"chargeType": "UnusedReservation",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
UsageDetailsExpand-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?$expand=meterDetails,additionalInfo&$filter=tags eq 'dev:tools'&$top=1&api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": {
"meterName": "Data Transfer Out (GB)",
"meterCategory": "Networking",
"meterSubCategory": "ExpressRoute",
"unitOfMeasure": "GB",
"serviceFamily": "Compute"
},
"quantity": 0.8234,
"effectivePrice": 0.010464556322455,
"cost": 0.000342194841184,
"unitPrice": 3.54,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"frequency": "UsageBased",
"additionalInfo": "{\"MyType\":\"\",\"ServiceType\":\"\",\"VMName\":\"\",\"UsageType\":\"MyUsage\"}",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
UsageDetailsList-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"accountName": "AccountName",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"date": "2019-04-09T00:00:00.0000000Z",
"product": "Product1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 3.6E-05,
"effectivePrice": 0.054693034210767,
"cost": 1.980949998E-06,
"unitPrice": 5.47,
"billingCurrency": "CAD",
"resourceLocation": "uswest",
"consumedService": "Microsoft.ClassicStorage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceName": "ResourceName1",
"invoiceSection": "Invoice Section 1",
"costCenter": "BAS",
"resourceGroup": "Resource-Group-westus",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"frequency": "UsageBased",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
UsageDetailsListByMetricActualCost-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01&metric=actualcost
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"accountName": "AccountName",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"date": "2019-04-09T00:00:00.0000000Z",
"product": "Product1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 3.6E-05,
"effectivePrice": 0.054693055510767,
"cost": 1.968949998E-06,
"unitPrice": 5.47,
"billingCurrency": "CAD",
"resourceLocation": "uswest",
"consumedService": "Microsoft.ClassicStorage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceName": "ResourceName1",
"invoiceSection": "Invoice Section 1",
"costCenter": "BAS",
"resourceGroup": "Resource-Group-westus",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
UsageDetailsListByMetricAmortizedCost-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01&metric=amortizedcost
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"accountName": "AccountName",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"date": "2019-04-09T00:00:00.0000000Z",
"product": "Product1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 3.6E-05,
"effectivePrice": 0.054693055510767,
"cost": 1.968949998E-06,
"unitPrice": 5.47,
"billingCurrency": "CAD",
"resourceLocation": "uswest",
"consumedService": "Microsoft.ClassicStorage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceName": "ResourceName1",
"invoiceSection": "Invoice Section 1",
"costCenter": "BAS",
"resourceGroup": "Resource-Group-westus",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"frequency": "UsageBased",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
UsageDetailsListByMetricUsage-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01&metric=usage
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Customer Name 1",
"billingPeriodStartDate": "2019-04-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-04-30T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Customer Name 1",
"accountName": "AccountName",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "SubscriptionName 1",
"date": "2019-04-09T00:00:00.0000000Z",
"product": "Product1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 3.6E-05,
"effectivePrice": 0.054693055510767,
"cost": 1.968949998E-06,
"unitPrice": 5.47,
"billingCurrency": "CAD",
"resourceLocation": "uswest",
"consumedService": "Microsoft.ClassicStorage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource-Group-westus/providers/Microsoft.ClassicStorage/storageAccounts/ResourceName1",
"resourceName": "ResourceName1",
"invoiceSection": "Invoice Section 1",
"costCenter": "BAS",
"resourceGroup": "Resource-Group-westus",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
UsageDetailsListFilterByTag-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?$filter=tags eq 'dev:tools'&api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.8234,
"effectivePrice": 0.010534556373432,
"cost": 0.000342194841184,
"unitPrice": 3.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
UsageDetailsListForBillingPeriod-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2023-05-01
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDetails_Id1",
"name": "usageDetails_Id1",
"type": "Microsoft.Consumption/usageDetails",
"kind": "legacy",
"tags": {
"env": "newcrp",
"dev": "tools"
},
"properties": {
"billingAccountId": "xxxxxxxx",
"billingAccountName": "Account Name 1",
"billingPeriodStartDate": "2019-03-01T00:00:00.0000000Z",
"billingPeriodEndDate": "2019-03-31T00:00:00.0000000Z",
"billingProfileId": "xxxxxxxx",
"billingProfileName": "Account Name 1",
"accountName": "Account Name 1",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "Subscription Name 1",
"date": "2019-03-30T00:00:00.0000000Z",
"product": "Product Name 1",
"partNumber": "Part Number 1",
"meterId": "00000000-0000-0000-0000-000000000000",
"meterDetails": null,
"quantity": 0.8234,
"effectivePrice": 0.010534556373432,
"cost": 0.000342194841184,
"unitPrice": 3.74,
"billingCurrency": "CAD",
"resourceLocation": "USEast",
"consumedService": "Microsoft.Storage",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Resource Group 1/providers/Microsoft.Storage/storageAccounts/Resource Name 1",
"resourceName": "Resource Name 1",
"invoiceSection": "Invoice Section 1",
"costCenter": "DEV",
"resourceGroup": "Resource Group 1",
"offerId": "Offer Id 1",
"isAzureCreditEligible": false,
"chargeType": "Usage",
"benefitId": "00000000-0000-0000-0000-000000000000",
"benefitName": "Reservation_purchase_03-09-2018_10-59"
}
}
]
}
定义
名称 | 说明 |
---|---|
Error |
错误的详细信息。 |
Error |
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。 某些错误响应:
|
Legacy |
旧版使用情况详细信息。 |
Meter |
计量详细信息的属性。 |
metrictype |
允许选择不同类型的成本/使用情况记录。 |
Modern |
新式使用情况详细信息。 |
pricing |
指示计量器定价方式的标识符。 |
Usage |
列出使用情况详细信息的结果。 它包含按计费周期按反向时间顺序排列的可用使用情况详细信息列表。 |
ErrorDetails
错误的详细信息。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
message |
string |
指示操作失败原因的错误消息。 |
ErrorResponse
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。
某些错误响应:
429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。
503 ServiceUnavailable - 服务暂时不可用。 等待“Retry-After”标头中指定的时间后重试。
名称 | 类型 | 说明 |
---|---|---|
error |
错误的详细信息。 |
LegacyUsageDetail
旧版使用情况详细信息。
名称 | 类型 | 说明 |
---|---|---|
etag |
string |
资源的 etag。 |
id |
string |
事件的完整限定 ARM ID。 |
kind |
string:
legacy |
指定使用详细信息的类型。 |
name |
string |
唯一标识事件的 ID。 |
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 |
计费周期结束日期。 |
properties.billingPeriodStartDate |
string |
计费周期开始日期。 |
properties.billingProfileId |
string |
计费配置文件标识符。 |
properties.billingProfileName |
string |
计费对象信息名称。 |
properties.chargeType |
string |
指示费用表示额度、使用情况、市场购买、预留费用或退款。 |
properties.consumedService |
string |
使用的服务名称。 发出使用情况或已购买的 Azure 资源提供程序的名称。 未为市场使用提供此值。 |
properties.cost |
number |
税前成本金额。 |
properties.costCenter |
string |
此部门的成本中心(如果它是一个部门,并且提供了一个成本中心)。 |
properties.date |
string |
使用情况记录的日期。 |
properties.effectivePrice |
number |
按使用量收费的有效价格。 |
properties.frequency |
string |
指示此费用的发生频率。 OneTime 用于仅发生一次的购买,每月针对每月重复的费用,使用基于服务使用量的费用。 |
properties.invoiceSection |
string |
发票科目名称。 |
properties.isAzureCreditEligible |
boolean |
是否符合 Azure 额度条件。 |
properties.meterDetails |
有关计量的详细信息。 默认情况下,除非在 $expand 中指定,否则不会填充它。 |
|
properties.meterId |
string |
计量 ID (GUID) 。 不适用于市场。 对于预留实例,它表示为其购买预留的主计量。 有关为其购买预留的实际 VM 大小,请参阅 productOrderName。 |
properties.offerId |
string |
产品/服务 ID。例如:MS-AZR-0017P、MS-AZR-0148P。 |
properties.partNumber |
string |
所用服务的部件号。 可用于联接价目表。 不适用于市场。 |
properties.payGPrice |
number |
资源的零售价格。 |
properties.planName |
string |
计划名称。 |
properties.pricingModel |
指示计量器定价方式的标识符。 |
|
properties.product |
string |
使用的服务或购买的产品名称。 不适用于市场。 |
properties.productOrderId |
string |
产品订单 ID。对于预留,这是预留订单 ID。 |
properties.productOrderName |
string |
产品订单名称。 对于预留,这是购买的 SKU。 |
properties.publisherName |
string |
发布者名称。 |
properties.publisherType |
string |
发布服务器类型。 |
properties.quantity |
number |
使用数量。 |
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 个月。 1 年预留 12 个月。 3 年预留 36 个月。 |
properties.unitPrice |
number |
单价是适用于你的价格。 (EA 或其他合同价格) 。 |
tags |
object |
资源标记。 |
type |
string |
资源类型。 |
MeterDetailsResponse
计量详细信息的属性。
名称 | 类型 | 说明 |
---|---|---|
meterCategory |
string |
计量的类别,例如“云服务”、“网络”等。 |
meterName |
string |
给定计量类别中的计量名称 |
meterSubCategory |
string |
计量的子类别,例如“A6 云服务”、“ExpressRoute (IXP) ”等。 |
serviceFamily |
string |
服务系列。 |
unitOfMeasure |
string |
计量消耗量计费的单位,例如“小时”、“GB”等。 |
metrictype
允许选择不同类型的成本/使用情况记录。
名称 | 类型 | 说明 |
---|---|---|
actualcost |
string |
实际成本数据。 |
amortizedcost |
string |
摊销成本数据。 |
usage |
string |
使用情况数据。 |
ModernUsageDetail
新式使用情况详细信息。
名称 | 类型 | 说明 |
---|---|---|
etag |
string |
资源的 etag。 |
id |
string |
事件的完整限定 ARM ID。 |
kind |
string:
modern |
指定使用详细信息的类型。 |
name |
string |
唯一标识事件的 ID。 |
properties.additionalInfo |
string |
此使用情况项的其他详细信息。 使用此字段可获取特定于使用情况行项的详细信息,例如实际 VM 大小 (ServiceType) 或应用预留折扣的比率。 |
properties.benefitId |
string |
适用权益的唯一标识符。 |
properties.benefitName |
string |
适用权益的名称。 |
properties.billingAccountId |
string |
计费帐户标识符。 |
properties.billingAccountName |
string |
计费帐户的名称。 |
properties.billingCurrencyCode |
string |
定义计费成本的货币。 |
properties.billingPeriodEndDate |
string |
计费周期结束日期,如发票中所示。 |
properties.billingPeriodStartDate |
string |
计费周期开始日期与发票中一样。 |
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 |
以计费货币表示的扩展成本或税前混合成本。 |
properties.costInPricingCurrency |
number |
与价格关联的采用定价货币的 ExtendedCost 或混合税前成本。 |
properties.costInUSD |
number |
估计的扩展成本或混合成本税前成本(以美元为单位)。 |
properties.customerName |
string |
客户的 AAD 租户的名称。 |
properties.customerTenantId |
string |
客户的 AAD 租户的标识符。 |
properties.date |
string |
使用情况记录的日期。 |
properties.effectivePrice |
number |
按使用量收费的有效价格。 |
properties.exchangeRate |
string |
从定价货币转换为计费货币时使用的汇率。 |
properties.exchangeRateDate |
string |
从定价货币转换为计费货币时使用的汇率的日期。 |
properties.exchangeRatePricingToBilling |
number |
从定价货币到计费货币的汇率。 |
properties.frequency |
string |
指示此费用的发生频率。 OneTime 用于仅发生一次的购买,每月针对每月重复的费用,使用基于服务使用量的费用。 |
properties.instanceName |
string |
实例名称。 |
properties.invoiceId |
string |
发票 ID 在显示特定交易的发票上。 |
properties.invoiceSectionId |
string |
在发票中计费的项目的标识符。 不适用于合作伙伴加入的 Microsoft 客户协议。 |
properties.invoiceSectionName |
string |
在发票中计费的项目的名称。 不适用于合作伙伴加入的 Microsoft 客户协议。 |
properties.isAzureCreditEligible |
boolean |
确定是否有资格使用 Azure 额度支付成本。 |
properties.marketPrice |
number |
按使用量收费的市场价格。 |
properties.meterCategory |
string |
标识使用情况的顶级服务。 |
properties.meterId |
string |
计量 ID (GUID) 。 不适用于市场。 对于预留实例,它表示为其购买预留的主计量。 有关为其购买预留的实际 VM 大小,请参阅 productOrderName。 |
properties.meterName |
string |
标识度量消耗量所针对的计量器的名称。 |
properties.meterRegion |
string |
指明某些服务的数据中心的位置,这些服务根据数据中心位置进行定价。 |
properties.meterSubCategory |
string |
定义可能影响速率的 Azure 服务的类型或子类别。 |
properties.partnerEarnedCreditApplied |
string |
指示是否已应用合作伙伴赚取的额度的标志。 |
properties.partnerEarnedCreditRate |
number |
存在基于合作伙伴管理员链接访问的合作伙伴赚取的返点 (PEC) 时应用的折扣率。 |
properties.partnerName |
string |
合作伙伴的 AAD 租户的名称。 |
properties.partnerTenantId |
string |
合作伙伴的 AAD 租户的标识符。 |
properties.payGPrice |
number |
资源的零售价格。 |
properties.paygCostInBillingCurrency |
number |
以计费货币为单位的 PayG 税前成本金额。 |
properties.paygCostInUSD |
number |
以美元货币计算的 PayG 税前成本金额。 |
properties.previousInvoiceId |
string |
有退款(负成本)时对原始发票的引用。 仅当存在退款时,才会填充此数据。 |
properties.pricingCurrencyCode |
string |
定价计费货币。 |
properties.pricingModel |
指示计量定价方式的标识符 |
|
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 |
测量购买或消耗的数量。计费周期内使用的计量量。 |
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 |
为服务用量分级费用时的时段结束日期。 将根据分级时段确定 Azure 服务的价格。 |
properties.servicePeriodStartDate |
string |
为服务用量分级费用时分级时段的开始日期。 将根据分级时段确定 Azure 服务的价格。 |
properties.subscriptionGuid |
string |
Microsoft 为 Azure 订阅生成的唯一标识符。 |
properties.subscriptionName |
string |
Azure 订阅的名称。 |
properties.term |
string |
学期 ((以月) 为单位)。 显示套餐的有效期限。 例如, 对于预留实例,它显示预留实例的年度期限为 12 个月。 对于一次性购买或定期购买,条款显示 1 个月;这不适用于 Azure 使用。 |
properties.unitOfMeasure |
string |
指明服务的计价单位。 例如,GB、小时、10,000 秒。 |
properties.unitPrice |
number |
单价是适用于你的价格。 (EA 或其他合同价格) 。 |
tags |
object |
资源标记。 |
type |
string |
资源类型。 |
pricingModelType
指示计量器定价方式的标识符。
名称 | 类型 | 说明 |
---|---|---|
On Demand |
string |
|
Reservation |
string |
|
Spot |
string |
UsageDetailsListResult
列出使用情况详细信息的结果。 它包含按计费周期按反向时间顺序排列的可用使用情况详细信息列表。
名称 | 类型 | 说明 |
---|---|---|
nextLink |
string |
链接 (url) 到结果的下一页。 |
value | UsageDetail[]: |
使用情况详细信息列表。 |