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

从 EA 预留实例费用 API 迁移

以前使用 Enterprise Reporting consumption.azure.com API 获取预留实例费用的 EA 客户需要迁移到奇偶校验 Azure 资源管理器 API。 以下说明可帮助你迁移和讨论旧 API 与新 API 之间的任何协定差异。

注意

所有 Azure 企业报告 API 均已停用。 你应尽快迁移到 Microsoft 成本管理 API

向服务主体分配权限以调用 API

在调用 API 之前,需要配置具有正确权限的服务主体。 使用服务主体调用 API。 有关详细信息,请参阅向成本管理 API 分配权限

调用预留实例费用 API

使用以下请求 URI 调用新的预留实例费用 API。

支持的请求

按日期范围获取预留费用

https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions?$filter=properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30&api-version=2023-05-01 

响应正文更改

旧响应:

[
    {
        "purchasingEnrollment": "string",
        "armSkuName": "Standard_F1s",
        "term": "P1Y",
        "region": "eastus",
        "PurchasingsubscriptionGuid": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
        "PurchasingsubscriptionName": "string",
        "accountName": "string",
        "accountOwnerEmail": "string",
        "departmentName": "string",
        "costCenter": "",
        "currentEnrollment": "string",
        "billingFrequency": "OneTime",
        "eventDate": "string",
        "reservationOrderId": "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
        "description": "Standard_F1s eastus 1 Year",
        "eventType": "Purchase",
        "quantity": int,
        "amount": double,
        "currency": "string",
        "reservationOrderName": "string"
    },
]

新响应:

{
  "id": "/billingAccounts/123456/providers/Microsoft.Consumption/reservationtransactions/201909091919",
  "name": "201909091919",
  "type": "Microsoft.Consumption/reservationTransactions",
  "tags": [],
  "properties": {
    "eventDate": "2019-09-09T19:19:04Z",
    "reservationOrderId": "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
    "description": "Standard_DS1_v2 westus 1 Year",
    "eventType": "Refund",
    "quantity": 1,
    "amount": -21,
    "currency": "USD",
    "reservationOrderName": "Transaction-DS1_v2",
    "purchasingEnrollment": "123456",
    "armSkuName": "Standard_DS1_v2",
    "term": "P1Y",
    "region": "westus",
    "purchasingSubscriptionGuid": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
    "purchasingSubscriptionName": "Infrastructure Subscription",
    "accountName": "Microsoft Infrastructure",
    "accountOwnerEmail": "admin@microsoft.com",
    "departmentName": "Unassigned",
    "costCenter": "",
    "currentEnrollment": "123456",
    "billingFrequency": "recurring",
    "billingMonth": 20190901,
    "monetaryCommitment": 523123.9,
    "overage": 23234.49
}