Dela via


Migrate from EA Reserved Instance Recommendations API

EA customers who were previously using the Enterprise Reporting consumption.azure.com API to obtain reserved instance recommendations need to migrate to a parity Azure Resource Manager API. The following instructions help you migrate and describe any contract differences between the old API and the new API.

Anmärkning

Alla Azure Enterprise Reporting-API:er har dragits tillbaka. Du bör migrera till Microsoft Cost Management-API:er så snart som möjligt.

Assign permissions to a service principle to call the API

Innan du anropar API:et måste du konfigurera ett huvudnamn för tjänsten med rätt behörighet. Du använder tjänstens huvudnamn för att anropa API:et. Mer information finns i Tilldela behörigheter till Cost Management-API:er.

Call the reserved instance recommendations API

Use the following request URIs to call the new Reservation Recommendations API.

Begäranden som stöds

Anropa API:et med följande omfång:

  • Registrering: providers/Microsoft.Billing/billingAccounts/{billingAccountId}
  • Prenumeration: subscriptions/{subscriptionId}
  • Resource Groups: subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}

Get Recommendations

Both the shared and the single scope recommendations are available through this API. You can also filter on the scope as an optional API parameter.

https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Consumption/reservationRecommendations?api-version=2023-05-01 

Response body changes

In the new API, recommendations for Shared and Single scopes are combined into one API.

Old response for Shared scope:

{
        "lookBackPeriod": "Last60Days",
        "meterId": "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
        "skuName": "Standard_B1s",
        "term": "P3Y",
        "region": "eastus",
        "costWithNoRI": 39.773316464000011,
        "recommendedQuantity": 2,
        "totalCostWithRI": 22.502541385887369,
        "netSavings": 17.270775078112642,
        "firstUsageDate": "2024-02-23T00:00:00",
        "resourceType": "virtualmachines",
        "instanceFlexibilityRatio": 2.0,
        "instanceFlexibilityGroup": "BS Series",
        "normalizedSize": "Standard_B1ls",
        "recommendedQuantityNormalized": 4.0,
        "skuProperties": [
          {
            "name": "Cores",
            "value": "1"
          },
          {
            "name": "Ram",
            "value": "1"
          }
        ]
    },

Old response for Single scope:

{
      "subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
      "lookBackPeriod": "Last60Days",
      "meterId": "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
      "skuName": "Standard_B1s",
      "term": "P3Y",
      "region": "eastus",
      "costWithNoRI": 19.892601567999996,
      "recommendedQuantity": 1,
      "totalCostWithRI": 11.252968788943683,
      "netSavings": 8.6396327790563134,
      "firstUsageDate": "2024-02-23T00:00:00",
      "resourceType": "virtualmachines",
      "instanceFlexibilityRatio": 2.0,
      "instanceFlexibilityGroup": "BS Series",
      "normalizedSize": "Standard_B1ls",
      "recommendedQuantityNormalized": 2.0,
      "skuProperties": [
        {
          "name": "Cores",
          "value": "1"
        },
        {
          "name": "Ram",
          "value": "1"
        }
      ]
}

Nytt svar:

{
  "value": [
    {
      "id": "billingAccount/123456/providers/Microsoft.Consumption/reservationRecommendations/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
      "name": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
      "type": "Microsoft.Consumption/reservationRecommendations",
      "location": "westus",
      "sku": "Standard_DS1_v2",
      "kind": "legacy",
      "properties": {
        "meterId": "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
        "term": "P1Y",
        "costWithNoReservedInstances": 12.0785105,
        "recommendedQuantity": 1,
        "totalCostWithReservedInstances": 11.4899644807748,
        "netSavings": 0.588546019225182,
        "firstUsageDate": "2019-07-07T00:00:00-07:00",
        "scope": "Shared",
        "lookBackPeriod": "Last7Days",
        "instanceFlexibilityRatio": 1,
        "instanceFlexibilityGroup": "DSv2 Series",
        "normalizedSize": "Standard_DS1_v2",
        "recommendedQuantityNormalized": 1,
        "skuProperties": [
          {
            "name": "Cores",
            "value": "1"
          },
          {
            "name": "Ram",
            "value": "1"
          }
        ]
      }
    },
   ]
}