你当前正在访问 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?$expand={$expand}&$filter={$filter}&$skiptoken={$skiptoken}&$top={$top}&api-version=2024-08-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}” , billingProfile 范围的'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'、'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfileId}/invoiceSections/{invoiceSectionId}'和'/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/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: 1maximum: 1000 |
可用于将结果数限制为最新的 N usageDetails。 |
|
metric
|
query |
允许选择不同类型的成本/使用情况记录。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
还行。 请求已成功。 |
|
204 No Content |
无内容。 请求已成功,但未返回任何结果。 |
|
Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
BillingAccountUsageDetailsList-Legacy
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
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": [
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/EnrollmentAccounts/1234/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
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=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=actualcost
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=amortizedcost
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01&metric=usage
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?$filter=tags eq 'dev:tools'&api-version=2024-08-01
示例响应
{
"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
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails?api-version=2024-08-01
示例响应
{
"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”标头中指定的时间后重试。
504 网关超时 - 处理请求时服务超时。 尽可能减少请求中的日期范围。
名称 | 类型 | 说明 |
---|---|---|
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 (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 |
有关计量的详细信息。 默认情况下,除非在$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 |
指示计量器定价方式的标识符。 |
|
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 或其他合同价格)。 |
tags |
object |
资源标记。 |
type |
string |
资源类型。 |
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 |
事件的完整限定 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 (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 |
指示计量定价方式的标识符 |
|
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 或其他合同价格)。 |
tags |
object |
资源标记。 |
type |
string |
资源类型。 |
pricingModelType
指示计量器定价方式的标识符。
值 | 说明 |
---|---|
On Demand | |
Reservation | |
Spot |
UsageDetailsListResult
列出使用情况详细信息的结果。 它包含按计费周期按时间顺序排列的可用使用情况详细信息列表。
名称 | 类型 | 说明 |
---|---|---|
nextLink |
string |
指向下一页结果的链接(url)。 |
value | UsageDetail[]: |
使用情况详细信息的列表。 |