您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

获取企业协议保留成本和使用情况Get Enterprise Agreement reservation costs and usage

预留成本和使用情况数据则是适用于企业协议客户在 Azure 门户和 REST Api。Reservation costs and usage data are available for Enterprise Agreement customers in the Azure portal and REST APIs. 本文可帮助你:This article helps you:

  • 获取预订购买数据Get reservation purchase data
  • 获取保留未得到充分利用数据Get reservation under-utilization data
  • 摊销预订成本Amortize reservation costs
  • Chargeback 保留使用率Chargeback for reservation utilization
  • 计算保留节省Calculate reservation savings

在使用情况数据合并的 marketplace 费用。Marketplace charges are consolidated in usage data. 查看第一方使用情况、 marketplace 使用情况和单个数据源中的购买费用。You view charges for first party usage, marketplace usage, and purchases from a single data source.

Azure 使用情况数据中的预订费用Reservation charges in Azure usage data

数据划分为两个单独的数据集:实际成本_并_摊销成本Data is divided into two separate data sets: Actual Cost and Amortized Cost. 这两个数据集有何不同:How these two datasets differ:

实际成本-提供要与每月的帐单保持一致的数据。Actual Cost - Provides data to reconcile with your monthly bill. 此数据已预订购买成本。This data has reservation purchase costs. 它具有零个 EffectivePrice 接收预订折扣的使用情况。It has zero EffectivePrice for the usage that received the reservation discount.

摊销成本-资源获取预订折扣的 EffectiveCost 是保留的实例的每天按比例分摊的成本。Amortized Cost - The resource EffectiveCost that gets the reservation discount is the prorated cost of the reserved instance. 数据集还具有未使用的预订成本。The dataset also has unused reservation costs. 保留费和未使用的预订的总和提供保留的每日摊销的成本。The sum of the reservation cost and unused reservation provides the daily amortized cost of the reservation.

两个数据集的比较:Comparison of two data sets:

DataData 实际成本数据集Actual Cost data set 摊销的成本数据集Amortized Cost data set
预订购买Reservation purchases 在此视图中可用。Available in this view.

若要获得此数据筛选器在 ChargeType ="采购"。To get this data filter on ChargeType = "Purchase".

请参阅 ReservationID 或 ReservationName 知道费用是针对哪些保留。Refer to ReservationID or ReservationName to know which reservation the charge is for.
此视图不适用于。Not applicable to this view.

摊销数据中未提供的采购成本。Purchase costs aren't provided in amortized data.
EffectivePriceEffectivePrice 值为零的使用情况,可获取预订折扣。The value is zero for usage that gets reservation discount. 值为已预订折扣的使用情况的保留的每小时按比例分配成本。The value is per-hour prorated cost of the reservation for usage that has the reservation discount.
未使用的预订 (提供的预订未使用在一天中的小时数和浪费的货币值)Unused reservation (Provides the number of hours the reservation wasn't used in a day and the monetary value of the waste) 在此视图中不适用。Not applicable in this view. 在此视图中可用。Available in this view.

若要获取此数据,筛选 ChargeType = "UnusedReservation"。To get this data, filter on ChargeType = "UnusedReservation".

请参阅 ReservationID 或 ReservationName 知道哪些保留了未被充分利用。Refer to ReservationID or ReservationName to know which reservation was underutilized. 这是多少预订浪费在上一天。This is how much of the reservation was wasted in for the day.
单价 (价格表中的资源的价格)UnitPrice(Price of the resource from your price sheet) 可用Available 可用Available

Azure 使用情况数据中可用的其他信息已更改:Other information available in Azure usage data has changed:

  • 产品和计量信息-Azure 不会替换为最初已使用的计量的 ReservationId 和 ReservationName,就像以前一样。Product and Meter information - Azure doesn't replace the originally consumed meter with the ReservationId and ReservationName, as it did previously.
  • ReservationId 和 ReservationName-它们是其自己数据中的字段。ReservationId and ReservationName - They are their own fields in the data. 以前,它使用为仅在 AdditionalInfo 下可用。Previously, it used to be available only under AdditionalInfo.
  • ProductOrderId-预订订单 ID,作为其自己的字段添加。ProductOrderId - The reservation order ID, added as its own field.
  • ProductOrderName-购买的预订的产品名称。ProductOrderName - The product name of the purchased reservation.
  • 术语的 12 个月或 36 个月。Term - 12 months or 36 months.
  • RINormalizationRatio-AdditionalInfo 下可用。RINormalizationRatio - Available under AdditionalInfo. 这是比预订应用于使用情况记录的位置。This is the ratio where the reservation is applied to the usage record. 如果实例大小灵活性上启用了预订,则它可以将应用于其他大小。If instance size flexibility is enabled on for your reservation, then it can apply to other sizes. 值显示的使用情况记录已应用于保留的比率。The value shows the ratio that the reservation was applied to for the usage record.

获取使用 API 的 Azure 使用情况和预订使用情况数据Get Azure consumption and reservation usage data using API

可以使用该 API 获取数据或从 Azure 门户下载它。You can get the data using the API or download it from Azure portal.

在调用使用情况详细信息 API API 版本"2019年-04-01-预览"获取新数据。You call the Usage Details API with API version "2019-04-01-preview" to get the new data. 有关术语的详细信息,请参阅使用条款For details about terminology, see usage terms. 调用方应为企业协议使用的企业管理员EA 门户The caller should be an Enterprise Administrator for the enterprise agreement using the EA portal. 只读的企业管理员还可以获取数据。Read-only Enterprise Administrators can also get the data.

数据中不可适用于企业客户的使用情况详细信息的报告 ApiThe data is not available in Reporting APIs for Enterprise customers - Usage Details.

下面是对 API 的示例调用:Here's an example call to the API:

https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{enrollmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodId}/providers/Microsoft.Consumption/usagedetails?metric={metric}&api-version=2019-04-01-preview&$filter={filter}

有关详细信息 {enrollmentId} 和 {billingPeriodId},请参阅用法的详细信息 – 列表API 文章。For more information about {enrollmentId} and {billingPeriodId}, see the Usage Details – List API article.

下表中有关度量值和筛选器的信息可帮助解决有关预订常见问题。Information in the following table about metric and filter can help solve for common reservation problems.

API 数据类型Type of API data API 调用操作API call action
所有费用 (使用情况和购买)All Charges (usage and purchases) {指标} 替换为 ActualCostReplace {metric} with ActualCost
获取预订折扣的使用情况Usage that got reservation discount {指标} 替换为 ActualCostReplace {metric} with ActualCost

将 {filter} 替换为: properties/reservationId%20ne%20Replace {filter} with: properties/reservationId%20ne%20
未获取预订折扣的使用情况Usage that didn't get reservation discount {指标} 替换为 ActualCostReplace {metric} with ActualCost

Replace {filter} with: properties/reservationId%20eq%20Replace {filter} with: properties/reservationId%20eq%20
摊销的费用 (使用情况和购买)Amortized charges (usage and purchases) {指标} 替换为 AmortizedCostReplace {metric} with AmortizedCost
未使用的预订报表Unused reservation report {指标} 替换为 AmortizedCostReplace {metric} with AmortizedCost

将 {filter} 替换为: properties/ChargeType%20eq%20'UnusedReservationReplace {filter} with: properties/ChargeType%20eq%20'UnusedReservation'
预订购买Reservation purchases {指标} 替换为 ActualCostReplace {metric} with ActualCost

将 {filter} 替换为: properties/ChargeType%20eq%20'PurchaseReplace {filter} with: properties/ChargeType%20eq%20'Purchase'
退款Refunds {指标} 替换为 ActualCostReplace {metric} with ActualCost

将 {filter} 替换为: properties/ChargeType%20eq%20'RefundReplace {filter} with: properties/ChargeType%20eq%20'Refund'

下载包含新数据的使用情况 CSV 文件Download the usage CSV file with new data

如果你是 EA 管理员,可以下载包含新的使用情况数据从 Azure 门户的 CSV 文件。If you are an EA admin, you can download the CSV file that contains new usage data from Azure portal. 此数据不会从可用EA 门户This data isn't available from the EA portal.

在 Azure 门户中,导航到成本管理 + 计费In the Azure portal, navigate to Cost management + billing.

  1. 选择计费帐户。Select the billing account.
  2. 单击使用情况 + 费用Click Usage + charges.
  3. 单击“下载” 。Click Download.
    显示在何处下载 Azure 门户中的 CSV 使用情况数据文件的示例Example showing where to Download the CSV usage data file in the Azure portal
  4. 在中下载使用情况 + 费用使用情况详细信息版本 2 ,选择 (使用情况和购买) 的所有费用,然后单击下载。In Download Usage + Charges , under Usage Details Version 2 , select All Charges (usage and purchases) and then click download. 重复这些步骤分摊费用 (使用情况和购买)Repeat for Amortized charges (usage and purchases).

所下载的 CSV 文件包含实际成本和摊销的成本。The CSV files that you download contain actual costs and amortized costs.

成本和使用情况的常见任务Common cost and usage tasks

以下各节是大多数人使用,以查看其保留成本和用量数据的常见任务。The following sections are common tasks that most people use to view their reservation cost and usage data.

获取预订的采购成本Get reservation purchase costs

实际成本数据中提供了保留项的采购成本。Reservation purchase costs are available in Actual Cost data. 筛选_ChargeType = 采购_。Filter for ChargeType = Purchase. 请参阅 ProductOrderID 来确定为用户购买的是哪个预订订单。Refer to ProductOrderID to determine which reservation order the purchase is for.

获取未充分利用的预订数量和成本Get underutilized reservation quantity and costs

获取摊销成本数据和筛选_ChargeType_ = UnusedReservationGet Amortized Cost data and filter for ChargeType = UnusedReservation. 可获得每日的未使用的预订数量和成本。You get the daily unused reservation quantity and the cost. 可以保留或保留顺序使用的数据进行筛选_ReservationId_并_ProductOrderId_字段,分别。You can filter the data for a reservation or reservation order using ReservationId and ProductOrderId fields, respectively. 如果保留利用率达到 100%,记录将具有数量为 0。If a reservation was 100% utilized, the record has a quantity of 0.

摊销预订成本Amortize reservation costs

获取摊销成本数据,并保留顺序使用的筛选_ProductOrderID_预订获取每日摊销的成本。Get Amortized Cost data and filter for a reservation order using ProductOrderID to get daily amortized costs for a reservation.

预订的退款Chargeback for a reservation

您可以用于其他组织的退款预订使用按订阅、 资源组或标记。You can chargeback reservation use to other organizations by subscription, resource groups, or tags. 摊销的成本数据提供了在以下数据类型的预订的利用率的货币值:Amortized cost data provides monetary value of a reservation's utilization at the following data types:

  • 资源 (例如 VM)Resources (such as a VM)
  • 资源组Resource group
  • TagsTags
  • 订阅Subscription

混合的速率获得退款Get the blended rate for chargeback

若要确定混合的速率,获取摊销的成本数据和聚合的总成本。To determine the blended rate, get the amortized costs data and aggregate the total cost. 对于 Vm,可以使用的计量名称或服务类型信息从 AdditionalInfo JSON 数据。For VMs, you can use either MeterName or ServiceType information from AdditionalInfo JSON data. 将划分的总成本由用来获取混合的率的数量。Divide the total cost by the quantity used to get the blended rate.

审核最佳预订实例使用大小大的灵活性Audit optimum reservation use for instance size flexibility

具有多个数量_RINormalizationRatio_,从 AdditionalInfo。Multiple the quantity with the RINormalizationRatio, from AdditionalInfo. 结果表明对使用情况记录应用的预订使用小时数。The results indicate how many hours of reservation use was applied to the usage record.

确定保留节省Determine reservation savings

获取 Amortized 成本数据和筛选数据的保留实例。Get the Amortized costs data and filter the data for a reserved instance. 然后:Then:

  1. 获取估计的即用即付成本。Get estimated pay-as-you-go costs. 乘_UnitPrice_值替换_Quantity_值,以获取估计的即用即付成本,如果预订折扣不适用于使用情况。Multiply the UnitPrice value with Quantity values to get estimated pay-as-you-go costs, if the reservation discount didn't apply to the usage.
  2. 获取保留成本。Get the reservation costs. 总和_成本_值,以获取你为保留的实例付费的货币值。Sum the Cost values to get the monetary value of what you paid for the reserved instance. 它包括使用和未使用预订的成本。It includes the used and unused costs of the reservation.
  3. 减去保留从估计的即用即付成本,以获取估计的节省成本。Subtract reservation costs from estimated pay-as-you-go costs to get the estimated savings.

预订购买和摊销成本分析Reservation purchases and amortization in cost analysis

预留成本均位于成本分析Reservation costs are available in cost analysis. 默认情况下成本分析显示实际成本,这是你的帐单上显示成本的方式。By default, cost analysis shows Actual cost, which is how costs will be shown on your bill. 若要查看预订购买细分和关联的资源的使用权益,请切换到摊销成本:To view reservation purchases broken down and associated with the resources which used the benefit, switch to Amortized cost:

显示在成本分析中选择摊销的成本的位置的示例

按费用类型的使用情况、 购买和退款; 看一个分行符进行分组或通过的保留和按需成本细分保留的项。Group by charge type to see a break down of usage, purchases, and refunds; or by reservation for a breakdown of reservation and on-demand costs. 请记住在查看实际成本时将看到仅保留成本是购买,但成本将分配给单个资源时查看摊销成本使用 benfit。Remember the only reservation costs you will see when looking at actual cost are purchases, but costs will be allocated to the individual resources which used the benfit when looking at amortized cost. 您还会看到一个新UnusedReservation收费类型时查看摊销成本。You will also see a new UnusedReservation charge type when looking at amortized cost.

需要帮助?Need help? 请联系我们。Contact us.

如有任何疑问或需要帮助,请创建支持请求If you have questions or need help, create a support request.

后续步骤Next steps

若要了解有关 Azure 预订的详细信息,请参阅以下文章:To learn more about Azure Reservations, see the following articles: