Consumption Usage Details API から移行する

この記事では、Consumption Usage Details API からの移行について説明します。 Consumption Usage Details API は非推奨です。 API がオフになる日付はまだ検討中です。 できるだけ早く API から移行することをお勧めします。

移行先

ワークロードに適したソリューションを選択する前に、「コストの詳細ソリューションの選択」の記事を参照してください。 一般に、継続的なデータ インジェストのニーズがある場合や、毎月の使用状況の詳細データセットが大きい場合は、エクスポートをお勧めします。 詳細については、「使用状況の詳細データを取り込む」を参照してください。

使用状況の詳細データセットが小さい場合やエクスポートで満たされないシナリオがある場合は、代わりに 「コスト詳細」レポートを使用することを検討してください。 詳細については、「オンデマンドで小規模なコスト データセットを取得する」を参照してください。

注意

コスト詳細レポートは、Enterprise Agreement または Microsoft 顧客契約を結んでいるお客様のみが使用できます。 MSDN、従量課金制や Visual Studio サブスクリプションをお持ちの場合は、エクスポートに移行するか、Consumption Usage Details API を引き続き使用できます。

移行の利点

新しいソリューションには、Consumption Usage Details API よりも多くの利点があります。 次に概要を示します。

  • すべての使用状況の詳細に対する 1 つのデータセット - Azure と Azure Marketplace の使用状況の詳細が 1 つのデータセットにマージされました。 これにより、すべての料金を確認するために呼び出す必要がある API の数が減ります。
  • スケーラビリティ - Marketplaces API は、Azure の使用量の増加に応じてスケーリングできない呼び出しパターンを促進するため、非推奨となっています。 使用状況の詳細データセットは、クラウドにデプロイするリソースが増えるにつれて、非常に大きくなる可能性があります。 Marketplaces API はページ分割された同期 API であるため、ネットワーク経由で大量のデータを効果的に高い効率と信頼性で転送するように最適化されていません。 エクスポートと Cost Details API は非同期です。 それらは、ネットワーク経由で直接ダウンロードできる CSV ファイルを提供します。
  • API の機能強化 - エクスポートと Cost Details API は、Azure が今後サポートするソリューションです。 すべての新機能がそれらに統合されています。
  • スキーマの一貫性 - コスト詳細レポートとエクスポートは、シナリオに基づいて、ソリューションから別のソリューションに移動できるように一致するフィールドがファイルに提供されています。
  • コスト割り当ての統合 - エンタープライズ契約および Microsoft 顧客契約のお客様は、エクスポートまたはCost Details API を使用して、構成したコスト割り当てルールに関連する料金を表示できます。 コスト割り当ての詳細については、「コストの割り当て」を参照してください。

フィールドの相違点

次の表は、Consumption Usage Details API と エクスポート/Cost Details API のフィールドの違いをまとめたものです。 エクスポートと Cost Details API は、Consumption API によって提供されるページ分割された JSON 応答の代わりに、CSV ファイルのダウンロードを提供します。

Enterprise Agreement のフィールド マッピング

Consumption Usage Details API を使用している Enterprise Agreement のお客様は、種類 が legacy の使用状況詳細レコードを持っています。 legacy の使用状況詳細レコードを下に示します。 Enterprise Agreement のすべてのお客様は、使用されている基になる課金システムにより、この種のレコードを持っています。

{  

  "value": [  

      {  

          "id": "{id}", 

          "name": "{name}",  

          "type": "Microsoft.Consumption/usageDetails",  

          "kind": "legacy",  

          "tags": {  

               "env": "newcrp",  

               "dev": "tools"  

          },  

          "properties": {  

…... 

      } 

} 

legacy の使用状況詳細レコードの完全な例は、「使用状況の詳細 - 一覧 - REST API (Azure Consumption)」に示されています

次の表に、古いフィールドと新しいフィールドのマッピングを示します。 新しいプロパティは、エクスポートと Cost Details API によって生成される CSV ファイルで使用できます。 フィールドの詳細については、使用状況詳細フィールドの理解に関する記事を参照してください。

太字のプロパティ名は変更されません。

以前のプロパティ 新しいプロパティ
accountName AccountName
AccountOwnerId AccountOwnerId
additionalInfo AdditionalInfo
AvailabilityZone AvailabilityZone
billingAccountId BillingAccountId
billingAccountName BillingAccountName
billingCurrency BillingCurrencyCode
billingPeriodEndDate BillingPeriodEndDate
billingPeriodStartDate BillingPeriodStartDate
billingProfileId BillingProfileId
billingProfileName BillingProfileName
chargeType ChargeType
consumedService ConsumedService
cost CostInBillingCurrency
costCenter CostCenter
日付 Date
effectivePrice EffectivePrice
frequency 頻度
invoiceSection InvoiceSectionName
InvoiceSectionId InvoiceSectionId
isAzureCreditEligible IsAzureCreditEligible
meterCategory MeterCategory
meterId MeterId
meterName MeterName
MeterRegion MeterRegion
meterSubCategory MeterSubCategory
offerId OfferId
partNumber PartNumber
PayGPrice PayGPrice
PlanName PlanName
PricingModel PricingModel
product ProductName
ProductOrderId ProductOrderId
ProductOrderName ProductOrderName
PublisherName 発行元
PublisherType PublisherType
数量 Quantity
ReservationId ReservationId
ReservationName ReservationName
resourceGroup ResourceGroup
resourceId ResourceId
resourceLocation ResourceLocation
resourceName ResourceName
serviceFamily ServiceFamily
ServiceInfo1 ServiceInfo1
ServiceInfo2 ServiceInfo2
subscriptionId SubscriptionId
subscriptionName SubscriptionName
タグ タグ
用語 期間
unitOfMeasure UnitOfMeasure
unitPrice UnitPrice
CostAllocationRuleName CostAllocationRuleName

Microsoft 顧客契約のフィールドのマッピング

Consumption Usage Details API を使用している Microsoft 顧客契約のお客様は、種類 が modern の使用状況の詳細レコードを持っています。 modern の使用状況の詳細レコードを下に示します。 Microsoft 顧客契約のすべてのお客様は、使用されている基になる課金システムにより、この種のレコードを持っています。

{  

  "value": [  

      {  

          "id": "{id}", 

          "name": "{name}",  

          "type": "Microsoft.Consumption/usageDetails",  

          "kind": "modern",  

          "tags": {  

               "env": "newcrp",  

               "dev": "tools"  

          },  

          "properties": {  

…... 

      } 

} 

modern の使用状況詳細レコードの完全な例は、「使用状況の詳細 - 一覧 - REST API (Azure Consumption)」に示されています

次の表に、古いフィールドと新しいフィールドのマッピングを示します。 新しいプロパティは、エクスポートと Cost Details API によって生成される CSV ファイルで使用できます。 ソリューション間の違いによりマッピングが必要なフィールドは、太字で表示されています。

詳細については、使用状況詳細フィールドの理解に関する記事を参照してください。

古いプロパティ 新しいプロパティ
invoiceld invoiceld
previousInvoiceId previousInvoiceId
billingAccountId billingAccountId
billingAccountName billingAccountName
billingProfileId billingProfileId
billingProfileName billingProfileName
invoiceSectionId invoiceSectionId
invoiceSectionName invoiceSectionName
partnerTenantId partnerTenantId
partnerName partnerName
resellerName resellerName
resellerMpnId resellerMpnId
customerTenantId customerTenantId
customerName customerName
costCenter costCenter
billingPeriodEndDate billingPeriodEndDate
billingPeriodStartDate billingPeriodStartDate
servicePeriodEndDate servicePeriodEndDate
servicePeriodStartDate servicePeriodStartDate
date date
serviceFamily serviceFamily
productOrderId productOrderId
productOrderName productOrderName
consumedService consumedService
meterId meterId
meterName meterName
meterCategory meterCategory
meterSubCategory meterSubCategory
meterRegion meterRegion
productIdentifier ProductId
product ProductName
subscriptionGuid SubscriptionId
subscriptionName subscriptionName
publisherType publisherType
publisherId publisherId
publisherName publisherName
resourceGroup resourceGroupName
INSTANCENAME ResourceId
resourceLocationNormalized location
resourceLocation location
effectivePrice effectivePrice
数量 数量
unitOfMeasure unitOfMeasure
chargeType chargeType
billingCurrencyCode billingCurrency
pricingCurrencyCode pricingCurrency
costInBillingCurrency costInBillingCurrency
costInPricingCurrency costInPricingCurrency
costInUsd costInUsd
paygCostInBillingCurrency paygCostInBillingCurrency
paygCostInUSD paygCostInUsd
exchangeRatePricingToBilling exchangeRatePricingToBilling
exchangeRateDate exchangeRateDate
isAzureCreditEligible isAzureCreditEligible
serviceInfo1 serviceInfo1
serviceInfo2 serviceInfo2
additionalInfo additionalInfo
tags tags
partnerEarnedCreditRate partnerEarnedCreditRate
partnerEarnedCreditApplied partnerEarnedCreditApplied
marketPrice PayGPrice
frequency frequency
語句 語句
reservationId reservationId
reservationName reservationName
pricingModel pricingModel
unitPrice unitPrice
exchangeRatePricingToBilling exchangeRatePricingToBilling

次のステップ