Usage Details - List
列出所定義範圍的使用量詳細數據。 使用量詳細數據僅適用於 2014 年 5 月 1 日或更新版本。
注意: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 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
scope
|
path | True |
string |
與使用量詳細數據作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. 針對訂用帳戶、計費帳戶、部門、註冊帳戶和管理群組,您也可以使用 '/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}/{billingProfileId}/invoiceSections/{invoiceSectionId}' 和 '/providers/Microsoft。Billing/billingAccounts/{billingAccountId}/customers/{customerId}' 特定合作夥伴。 |
api-version
|
query | True |
string |
要與用戶端要求搭配使用的 API 版本。 目前的版本是 2023-03-01。 |
$expand
|
query |
string |
可用來在使用量詳細數據清單中展開屬性/additionalInfo 或 properties/meterDetails。 根據預設,列出使用量詳細數據時,不會包含這些欄位。 |
|
$filter
|
query |
string |
可用來依 properties/resourceGroup、properties/resourceName、properties/resourceId、properties/resourceId、properties/chargeType、properties/reservationId、properties/publisherType 或標記來篩選 usageDetails。 篩選支援 'eq'、'lt'、'gt'、'le'、'ge'和 'and'。 它目前不支援 『ne』、『or』 或 『not』。 卷標篩選條件是索引鍵值組字串,其中索引鍵和值是以冒號分隔(:)。 PublisherType Filter 接受 azure 和 Marketplace 兩個值,目前支援 Web Direct 供應項目類型 |
|
$skiptoken
|
query |
string |
只有在先前的作業傳回部分結果時,才會使用Skiptoken。 如果先前的回應包含 nextLink 元素,則 nextLink 元素的值會包含 skiptoken 參數,指定要用於後續呼叫的起點。 |
|
$top
|
query |
integer (int32) minimum: 1maximum: 1000 |
可用來將結果數目限制為最新的 N usageDetails。 |
|
metric
|
query |
允許選取不同類型的成本/使用量記錄。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
還行。 要求已成功。 |
|
204 No Content |
沒有內容。 要求已成功,但未傳回任何結果。 |
|
Other Status Codes |
描述作業失敗原因的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 | Description |
---|---|
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"
}
}
]
}
定義
名稱 | Description |
---|---|
Error |
錯誤的詳細數據。 |
Error |
錯誤回應表示服務無法處理傳入要求。 錯誤訊息中會提供原因。 某些錯誤回應:
|
Legacy |
舊版使用量詳細數據。 |
Meter |
計量詳細數據的屬性。 |
metrictype |
允許選取不同類型的成本/使用量記錄。 |
Modern |
新式使用量詳細數據。 |
pricing |
指出計量價格的標識碼。 |
Usage |
列出使用量詳細數據的結果。 它包含依計費週期以反向時間順序的可用使用量詳細數據清單。 |
ErrorDetails
錯誤的詳細數據。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤碼。 |
message |
string |
錯誤訊息,指出作業失敗的原因。 |
ErrorResponse
錯誤回應表示服務無法處理傳入要求。 錯誤訊息中會提供原因。
某些錯誤回應:
429 TooManyRequests - 要求已節流。 等候 「x-ms-ratelimit-microsoft.consumption-retry-after」 標頭中指定的時間後重試。
503 ServiceUnavailable - 服務暫時無法使用。 等候 「Retry-After」 標頭中指定的時間後重試。
504 閘道逾時 - 處理要求時服務逾時。 儘可能減少要求中的日期範圍。
名稱 | 類型 | Description |
---|---|---|
error |
錯誤的詳細數據。 |
LegacyUsageDetail
舊版使用量詳細數據。
名稱 | 類型 | Description |
---|---|---|
etag |
string |
資源的 etag。 |
id |
string |
事件的完整ARM標識碼。 |
kind |
string:
legacy |
指定使用量詳細數據的種類。 |
name |
string |
可唯一識別事件的標識碼。 |
properties.accountName |
string |
帳戶名稱。 |
properties.accountOwnerId |
string |
帳戶擁有者標識碼。 |
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 |
表示費用代表點數、使用量、Marketplace 購買、保留費用或退款。 |
properties.consumedService |
string |
已取用的服務名稱。 發出使用量或已購買之 Azure 資源提供者的名稱。 未針對市集使用量提供此值。 |
properties.cost |
number (decimal) |
稅前的成本金額。 |
properties.costCenter |
string |
如果此部門是部門且提供成本中心,則為此部門的成本中心。 |
properties.date |
string (date-time) |
使用量記錄的日期。 |
properties.effectivePrice |
number (decimal) |
使用量所收取的有效價格。 |
properties.frequency |
string |
指出此費用的發生頻率。 OneTime 用於購買僅發生一次、每月遞歸費用的每月費用,以及根據服務使用量計算的費用使用量。 |
properties.invoiceSection |
string |
發票區段名稱。 |
properties.isAzureCreditEligible |
boolean |
符合 Azure 點數資格。 |
properties.meterDetails |
計量的詳細數據。 根據預設,除非在 $expand 中指定,否則不會填入此專案。 |
|
properties.meterId |
string (uuid) |
計量標識碼 (GUID)。 不適用於市集。 對於保留實例,這代表購買保留的主要計量。 如需購買保留的實際 VM 大小,請參閱 productOrderName。 |
properties.offerId |
string |
供應項目標識碼。例如:MS-AZR-0017P、MS-AZR-0148P。 |
properties.partNumber |
string |
所使用的服務部分編號。 可以用來與價位表聯結。 不適用於市集。 |
properties.payGPrice |
number (decimal) |
資源的零售價格。 |
properties.planName |
string |
方案名稱。 |
properties.pricingModel |
指出計量價格的標識碼。 |
|
properties.product |
string |
已取用服務或購買的產品名稱。 不適用於 Marketplace。 |
properties.productOrderId |
string |
產品訂單標識碼。對於保留,這是保留訂單標識碼。 |
properties.productOrderName |
string |
產品名稱。 對於保留,這是已購買的SKU。 |
properties.publisherName |
string |
發行者名稱。 |
properties.publisherType |
string |
發行者類型。 |
properties.quantity |
number (decimal) |
使用量數量。 |
properties.reservationId |
string |
保留的 ARM 資源識別碼。 僅適用於與保留相關的記錄。 |
properties.reservationName |
string |
使用者提供的保留顯示名稱。 特定日期的姓氏會在每日數據中填入。 僅適用於與保留相關的記錄。 |
properties.resourceGroup |
string |
資源組名。 |
properties.resourceId |
string |
Azure Resource Manager 使用量詳細數據資源的唯一標識符。 |
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
計量詳細數據的屬性。
名稱 | 類型 | Description |
---|---|---|
meterCategory |
string |
計量的類別,例如「雲端服務」、「網路」等。 |
meterName |
string |
指定計量類別內計量的名稱 |
meterSubCategory |
string |
計量的子類別,例如 『A6 雲端服務』、『ExpressRoute (IXP)』等等。 |
serviceFamily |
string |
服務系列。 |
unitOfMeasure |
string |
計量耗用量計費單位,例如『Hours』、『GB』等。 |
metrictype
允許選取不同類型的成本/使用量記錄。
值 | Description |
---|---|
actualcost |
實際成本數據。 |
amortizedcost |
分攤成本數據。 |
usage |
使用量數據。 |
ModernUsageDetail
新式使用量詳細數據。
名稱 | 類型 | Description |
---|---|---|
etag |
string |
資源的 etag。 |
id |
string |
事件的完整ARM標識碼。 |
kind |
string:
modern |
指定使用量詳細數據的種類。 |
name |
string |
可唯一識別事件的標識碼。 |
properties.additionalInfo |
string |
此使用專案的其他詳細數據。 使用此欄位來取得使用量明細專案的特定詳細數據,例如實際 VM 大小 (ServiceType) 或套用保留折扣的比例。 |
properties.benefitId |
string |
適用權益的唯一標識碼。 |
properties.benefitName |
string |
適用權益的名稱。 |
properties.billingAccountId |
string |
計費帳戶標識碼。 |
properties.billingAccountName |
string |
計費帳戶的名稱。 |
properties.billingCurrencyCode |
string |
定義計費成本的貨幣。 |
properties.billingPeriodEndDate |
string (date-time) |
計費期間結束日期,如發票所示。 |
properties.billingPeriodStartDate |
string (date-time) |
發票中的計費周期開始日期。 |
properties.billingProfileId |
string |
帳單配置檔的標識碼,該配置檔會以單一計費貨幣將發票的成本分組到已上線Microsoft客戶合約的客戶,以及已進行 SaaS、Marketplace、RI 等權利購買的 CSP 客戶。 |
properties.billingProfileName |
string |
將發票成本以單一計費貨幣分組的帳單配置檔名稱,這些客戶已上線Microsoft客戶合約的客戶,以及已購買 SaaS、Marketplace、RI 等權利購買的 CSP 客戶。 |
properties.chargeType |
string |
表示費用代表點數、使用量、Marketplace 購買、保留費用或退款。 |
properties.consumedService |
string |
已取用的服務名稱。 發出使用量或已購買之 Azure 資源提供者的名稱。 未針對市集使用量提供此值。 |
properties.costAllocationRuleName |
string |
成本配置規則的名稱。 |
properties.costCenter |
string |
如果此部門是部門且提供成本中心,則為此部門的成本中心。 |
properties.costInBillingCurrency |
number (decimal) |
以計費貨幣稅前的 ExtendedCost 或混合成本。 |
properties.costInPricingCurrency |
number (decimal) |
要與價格相互關聯的稅前延伸成本或混合成本 (以帳單貨幣為單位)。 |
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 用於購買僅發生一次、每月遞歸費用的每月費用,以及根據服務使用量計算的費用使用量。 |
properties.instanceName |
string |
實例名稱。 |
properties.invoiceId |
string |
發票標識碼,如同顯示特定交易的發票。 |
properties.invoiceSectionId |
string |
在發票中計費之專案的識別碼。 不適用於合作夥伴所登錄的 Microsoft 客戶合約。 |
properties.invoiceSectionName |
string |
在發票中計費之專案的名稱。 不適用於合作夥伴所登錄的 Microsoft 客戶合約。 |
properties.isAzureCreditEligible |
boolean |
判斷成本是否符合使用 Azure 點數付費的資格。 |
properties.marketPrice |
number (decimal) |
使用量收取的市場價格。 |
properties.meterCategory |
string |
識別使用量的最上層服務。 |
properties.meterId |
string (uuid) |
計量標識碼 (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 |
消費或購買所累積費用的產品名稱,如發票中所列。 不適用於 Marketplace。 |
properties.productIdentifier |
string |
消費或購買所產生費用的產品標識碼。 這是合作夥伴中心 productId 和 SkuId 的串連密鑰。 |
properties.productOrderId |
string |
訂用帳戶所屬資產或 Azure 方案名稱的標識碼。 例如:Azure 方案。 對於保留,這是保留訂單標識碼。 |
properties.productOrderName |
string |
產品名稱。 對於保留,這是已購買的SKU。 |
properties.provider |
string |
產品類別或企業營運的標識碼,例如 - Azure、Microsoft 365、AWS e.t.c |
properties.publisherId |
string |
發行者標識碼。 |
properties.publisherName |
string |
服務發行者的名稱,包括Microsoft或第三方發行者。 |
properties.publisherType |
string |
識別發行者是否為第一方、第三方轉銷商或第三方代理機構的發行者類型。 |
properties.quantity |
number (decimal) |
測量購買或取用的數量。計費期間所使用的計量量。 |
properties.resellerMpnId |
string |
與訂用帳戶相關聯的轉銷商 MPNId。 |
properties.resellerName |
string |
轉銷商名稱。 |
properties.reservationId |
string |
保留的 ARM 資源識別碼。 僅適用於與保留相關的記錄。 |
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
指出計量價格的標識碼。
值 | Description |
---|---|
On Demand | |
Reservation | |
Spot |
UsageDetailsListResult
列出使用量詳細數據的結果。 它包含依計費週期以反向時間順序的可用使用量詳細數據清單。
名稱 | 類型 | Description |
---|---|---|
nextLink |
string |
結果下一頁的連結(url)。 |
value | UsageDetail[]: |
使用量詳細數據的清單。 |