Skip to content

Commit 4170d70

Browse files
Merge pull request #211965 from bandersmsft/migrate-cm-api09202022
MCM - Update to migrate CM API
2 parents fc330b3 + f3cd659 commit 4170d70

File tree

1 file changed

+18
-63
lines changed

1 file changed

+18
-63
lines changed

articles/cost-management-billing/costs/migrate-cost-management-api.md

Lines changed: 18 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.reviewer: micflan
1414

1515
This article helps you understand the data structure, API, and other system integration differences between Enterprise Agreement (EA) and Microsoft Customer Agreement (MCA) accounts. Cost Management supports APIs for both account types. Review the [Setup billing account for](../manage/mca-setup-account.md) Microsoft Customer Agreement article before continuing.
1616

17-
Organizations with an existing EA account should review this article in conjunction with setting up an MCA account. Previously, renewing an EA account required some minimal work to move from an old enrollment to a new one. However, migrating to an MCA account requires additional effort. Additional effort is because of changes in the underlying billing subsystem, which affect all cost-related APIs and service offerings.
17+
Organizations with an existing EA account should review this article when they set up an MCA account. Previously, renewing an EA account required some minimal work to move from an old enrollment to a new one. However, migrating to an MCA account requires extra effort. Extra effort is because of changes in the underlying billing subsystem, which affect all cost-related APIs and service offerings.
1818

1919
## MCA APIs and integration
2020

@@ -38,7 +38,7 @@ The following items help you transition to MCA APIs.
3838
- Update any programming code to [use Azure AD authentication](/rest/api/azure/#create-the-request).
3939
- Update any programming code to replace EA API calls with MCA API calls.
4040
- Update error handling to use new error codes.
41-
- Review additional integration offerings like Power BI for other needed action.
41+
- Review other integration offerings like Power BI for other needed action.
4242

4343
## EA APIs replaced with MCA APIs
4444

@@ -47,9 +47,9 @@ EA APIs use an API key for authentication and authorization. MCA APIs use Azure
4747
| Purpose | EA API | MCA API |
4848
| --- | --- | --- |
4949
| Balance and credits | [/balancesummary](/rest/api/billing/enterprise/billing-enterprise-api-balance-summary) | Microsoft.Billing/billingAccounts/billingProfiles/availableBalanceussae |
50-
| Usage (JSON) | [/usagedetails](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#json-format)[/usagedetailsbycustomdate](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#json-format) | [Microsoft.Consumption/usageDetails](/rest/api/consumption/usagedetails)¹ |
51-
| Usage (CSV) | [/usagedetails/download](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#csv-format)[/usagedetails/submit](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#csv-format) | [Microsoft.Consumption/usageDetails/download](/rest/api/consumption/usagedetails)¹ |
52-
| Marketplace Usage (CSV) | [/marketplacecharges](/rest/api/billing/enterprise/billing-enterprise-api-marketplace-storecharge)[/marketplacechargesbycustomdate](/rest/api/billing/enterprise/billing-enterprise-api-marketplace-storecharge) | [Microsoft.Consumption/usageDetails/download](/rest/api/consumption/usagedetails)¹ |
50+
| Usage (JSON) | [/usagedetails](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#json-format)[/usagedetailsbycustomdate](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#json-format) | [Choose a cost details solution](../automate/usage-details-best-practices.md) |
51+
| Usage (CSV) | [/usagedetails/download](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#csv-format)[/usagedetails/submit](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#csv-format) | [Choose a cost details solution](../automate/usage-details-best-practices.md) |
52+
| Marketplace Usage (CSV) | [/marketplacecharges](/rest/api/billing/enterprise/billing-enterprise-api-marketplace-storecharge)[/marketplacechargesbycustomdate](/rest/api/billing/enterprise/billing-enterprise-api-marketplace-storecharge) | [Choose a cost details solution](../automate/usage-details-best-practices.md) |
5353
| Billing periods | [/billingperiods](/rest/api/billing/enterprise/billing-enterprise-api-billing-periods) | Microsoft.Billing/billingAccounts/billingProfiles/invoices |
5454
| Price sheet | [/pricesheet](/rest/api/billing/enterprise/billing-enterprise-api-pricesheet) | Microsoft.Billing/billingAccounts/billingProfiles/pricesheet/default/download format=json\|csv Microsoft.Billing/billingAccounts/…/billingProfiles/…/invoices/… /pricesheet/default/download format=json\|csv Microsoft.Billing/billingAccounts/../billingProfiles/../providers/Microsoft.Consumption/pricesheets/download |
5555
| Reservation purchases | [/reservationcharges](/rest/api/billing/enterprise/billing-enterprise-api-reserved-instance-charges) | Microsoft.Billing/billingAccounts/billingProfiles/transactions |
@@ -98,7 +98,7 @@ To get available balances with the Available Balance API:
9898

9999
## APIs to get cost and usage
100100

101-
Get a daily breakdown of costs from Azure service usage, third-party Marketplace usage, and other Marketplace purchases with the following APIs. The following separate APIs were merged for Azure services and third-party Marketplace usage. The old APIs are replaced by the [Microsoft.Consumption/usageDetails](/rest/api/consumption/usagedetails) API. It adds Marketplace purchases, which were previously only shown in the balance summary to date.
101+
Get a daily breakdown of costs from Azure service usage, third-party Marketplace usage, and other Marketplace purchases with the following APIs. The following separate APIs were merged for Azure services and third-party Marketplace usage. The old APIs are replaced by either [Exports](ingest-azure-usage-at-scale.md) or the [Cost Details API](/rest/api/cost-management/generate-cost-details-report/create-operation). To choose the solution that's right for you, see [Choose a cost details solution](../automate/usage-details-best-practices.md). Both solutions provide the same Cost Details file and have marketplace purchases in the data, which were previously only shown in the balance summary to date.
102102

103103
- [Get usage detail/download](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#csv-format)
104104
- [Get usage detail/submit](/rest/api/billing/enterprise/billing-enterprise-api-usage-detail#csv-format)
@@ -107,68 +107,23 @@ Get a daily breakdown of costs from Azure service usage, third-party Marketplace
107107
- [Get marketplace store charge/marketplacecharges](/rest/api/billing/enterprise/billing-enterprise-api-marketplace-storecharge)
108108
- [Get marketplace store charge/marketplacechargesbycustomdate](/rest/api/billing/enterprise/billing-enterprise-api-marketplace-storecharge)
109109

110-
All Consumption APIs are replaced by native Azure APIs that use Azure AD for authentication and authorization. For more information about calling Azure REST APIs, see [Getting started with REST](/rest/api/azure/#create-the-request).
111-
112-
All the preceding APIs are replaced by the Consumption/Usage Details API.
113-
114-
To get usage details with the Usage Details API:
115-
116-
| Method | Request URI |
117-
| --- | --- |
118-
| GET | `https://management.azure.com/{scope}/providers/Microsoft.Consumption/usageDetails?api-version=2019-01-01` |
110+
Exports and the Cost Details API, as with all Cost Management APIs, are available at multiple scopes. For invoiced costs, as you would traditionally receive at an enrollment level, use the billing profile scope. For more information about Cost Management scopes, see [Understand and work with scopes](understand-work-scopes.md).
119111

120-
The Usage Details API, as with all Cost Management APIs, is available at multiple scopes. For invoiced costs, as you would traditionally receive at an enrollment level, use the billing profile scope. For more information about Cost Management scopes, see [Understand and work with scopes](understand-work-scopes.md).
121-
122-
| Type | ID format |
123-
| --- | --- |
124-
| Billing account | `/Microsoft.Billing/billingAccounts/{billingAccountId}` |
125-
| Billing profile | `/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}` |
126-
| Subscription | `/subscriptions/{subscriptionId}` |
127-
| Resource group | `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}` |
128-
129-
Use the following querystring parameters to update any programming code.
130-
131-
| Old parameters | New parameters |
112+
| **Type** | **ID format** |
132113
| --- | --- |
133-
| `billingPeriod={billingPeriod}` | Not supported |
134-
| `endTime=yyyy-MM-dd` | `endDate=yyyy-MM-dd` |
135-
| `startTime=yyyy-MM-dd` | `startDate=yyyy-MM-dd` |
136-
137-
The body of the response also changed.
138-
139-
Old response body:
140-
141-
```
142-
{
143-
"id": "string",
144-
"data": [{...}, ...],
145-
"nextLink": "string"
146-
}
147-
```
148-
149-
New response body:
150-
151-
```
152-
{
153-
"value": [{
154-
"id": "{scope}/providers/Microsoft.Consumption/usageDetails/###",
155-
"name": "###",
156-
"type": "Microsoft.Consumption/usageDetails",
157-
"tags": {...},
158-
"properties": [{...}, ...],
159-
"nextLink": "string"
160-
}, ...]
161-
}
162-
```
114+
| Billing account | /Microsoft.Billing/billingAccounts/{billingAccountId} |
115+
| Billing profile | /Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId} |
116+
| Subscription | /subscriptions/{subscriptionId} |
117+
| Resource group | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName} |
163118

164-
The property name containing the array of usage records changed from data to _values_. Each record used to have a flat list of detailed properties. However, each record now all details are now in a nested property named _properties_, except for tags. The new structure is consistent with other Azure APIs. Some property names have changed. The following table shows corresponding properties.
119+
Some property names have changed in the new Cost Details dataset available through Exports and Cost Details API. The following table shows corresponding properties.
165120

166121
| Old property | New property | Notes |
167122
| --- | --- | --- |
168123
| AccountId | N/A | The subscription creator isn't tracked. Use invoiceSectionId (same as departmentId). |
169124
| AccountNameAccountOwnerId and AccountOwnerEmail | N/A | The subscription creator isn't tracked. Use invoiceSectionName (same as departmentName). |
170125
| AdditionalInfo | additionalInfo | |
171-
| ChargesBilledSeparately | isAzureCreditEligible | Note that these properties are opposites. If isAzureCreditEnabled is true, ChargesBilledSeparately would be false. |
126+
| ChargesBilledSeparately | isAzureCreditEligible | The properties are opposites. If isAzureCreditEnabled is true, ChargesBilledSeparately would be false. |
172127
| ConsumedQuantity | quantity | |
173128
| ConsumedService | consumedService | Exact string values might differ. |
174129
| ConsumedServiceId | None | |
@@ -209,7 +164,7 @@ The property name containing the array of usage records changed from data to _va
209164
| SubscriptionGuid | subscriptionId | |
210165
| SubscriptionId | subscriptionId | |
211166
| SubscriptionName | subscriptionName | |
212-
| Tags | tags | The tags property applies to root object, not to the nested properties property. |
167+
| Tags | tags | The tags property applies to the root object, not to the properties nested property. |
213168
| UnitOfMeasure | unitOfMeasure | Exact string values differ. |
214169
| usageEndDate | date | |
215170
| Year | None | Parses year from date. |
@@ -340,7 +295,7 @@ OData-EntityId: {operationId}
340295
341296
```
342297

343-
Make another GET call to the location. The response to the GET call is the same until the operation reaches a completion or failure state. When completed, the response to the GET call location returns the download URL. Just as if the operation was executed at the same time. Here's an example:
298+
Make another GET call to the location. The response to the GET call is the same until the operation reaches a completion or failure state. When completed, the response to the GET call location returns the download URL as if the operation was executed at the same time. Here's an example:
344299

345300
```
346301
HTTP Status 200
@@ -391,7 +346,7 @@ Instead of the above API endpoints, use the following ones for Microsoft Custome
391346

392347
**Price Sheet API for Microsoft Customer Agreements (asynchronous REST API)**
393348

394-
This API is for Microsoft Customer Agreements and it provides additional attributes.
349+
This API is for Microsoft Customer Agreements and it provides extra attributes.
395350

396351
**Price Sheet for a Billing Profile scope in a Billing Account**
397352

@@ -458,7 +413,7 @@ The following fields are either not available in Microsoft Customer Agreement Pr
458413
| unit | Not applicable. Can be parsed from unitOfMeasure. |
459414
| currencyCode | Same as the pricingCurrency in MCA. |
460415
| meterLocation | Same as the meterRegion in MCA. |
461-
| partNumber partnumber | Not applicable because part number isn't listed in MCA invoices. Instead of part number, use the meterId and productOrderName combination to uniquely identify prices. |
416+
| partNumber | Not applicable because part number isn't listed in MCA invoices. Instead of part number, use the meterId and productOrderName combination to uniquely identify prices. |
462417
| totalIncludedQuantity | Not applicable. |
463418
| pretaxStandardRate | Not applicable. |
464419

0 commit comments

Comments
 (0)