从 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.chinacloudapi.cn/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": "chinanorth",
        "PurchasingsubscriptionGuid": "00000000-0000-0000-0000-000000000000",
        "PurchasingsubscriptionName": "string",
        "accountName": "string",
        "accountOwnerEmail": "string",
        "departmentName": "string",
        "costCenter": "",
        "currentEnrollment": "string",
        "billingFrequency": "OneTime",
        "eventDate": "string",
        "reservationOrderId": "00000000-0000-0000-0000-000000000000",
        "description": "Standard_F1s chinanorth 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": "00000000-0000-0000-0000-000000000000",
        "description": "Standard_DS1_v2 chinanorth 1 Year",
    "eventType": "Refund",
    "quantity": 1,
    "amount": -21,
    "currency": "USD",
    "reservationOrderName": "Transaction-DS1_v2",
    "purchasingEnrollment": "123456",
    "armSkuName": "Standard_DS1_v2",
    "term": "P1Y",
        "region": "chinanorth",
    "purchasingSubscriptionGuid": "a838a8c3-a408-49e1-ac90-42cb95bff9b2",
    "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
}