共用方式為


從 EA 餘額摘要 API 移轉

先前使用 Enterprise 報表 consumption.azure.com API 取得餘額摘要的 EA 客戶,需要移轉到取代的 Azure Resource Manager API。 下列指示可協助您移轉和討論舊 API 與新 API 之間的任何合約差異。

注意

所有 Azure 企業報告 API 都會淘汰。 您應該儘快移轉至 Microsoft 成本管理 API

將許可權指派給服務主體以呼叫 API

呼叫 API 之前,您必須使用正確的權限設定服務主體。 您可以使用服務主體呼叫 API。 如需詳細資訊,請參閱 將許可權指派給成本管理 API

呼叫餘額摘要 API

呼叫新的餘額摘要 API 時,請使用下列要求 URI。 您的註冊號碼應該用來作為 billingAccountId

支援的要求

取得註冊

https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances?api-version=2023-05-01

回應主題變更

舊的回應主體:

{
  "id": "enrollments/100/billingperiods/201507/balancesummaries",
  "billingPeriodId": 201507,
  "currencyCode": "USD",
  "beginningBalance": 0,
  "endingBalance": 1.1,
  "newPurchases": 1,
  "adjustments": 1.1,
  "utilized": 1.1,
  "serviceOverage": 1,
  "chargesBilledSeparately": 1,
  "totalOverage": 1,
  "totalUsage": 1.1,
  "azureMarketplaceServiceCharges": 1,
  "newPurchasesDetails": [
    {
      "name": "",
      "value": 1
    }
  ],
  "adjustmentDetails": [
    {
      "name": "Promo Credit",
      "value": 1.1
    },
    {
      "name": "SIE Credit",
      "value": 1
    }
  ]
}

新的回應主體:

在新 API 回應的屬性欄位中,現在可以使用相同的資料。 某些欄位名稱的拼字可能會有些許變更。

{
  "id": "/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/balances/balanceId1",
  "name": "balanceId1",
  "type": "Microsoft.Consumption/balances",
  "properties": {
    "currency": "USD  ",
    "beginningBalance": 3396469.19,
    "endingBalance": 2922371.02,
    "newPurchases": 0,
    "adjustments": 0,
    "utilized": 474098.17,
    "serviceOverage": 0,
    "chargesBilledSeparately": 0,
    "totalOverage": 0,
    "totalUsage": 474098.17,
    "azureMarketplaceServiceCharges": 609.82,
    "billingFrequency": "Month",
    "priceHidden": false,
    "overageRefund": 2012.61,
    "newPurchasesDetails": [
      {
        "name": "Promo Purchase",
        "value": 1
      }
    ],
    "adjustmentDetails": [
      {
        "name": "Promo Credit",
        "value": 1.1
      },
      {
        "name": "SIE Credit",
        "value": 1
      }
    ]
  }
}