Edit

Share via


Tutorial: Use revisions to make nonbreaking API changes safely

APPLIES TO: All API Management tiers

When your API is used by developers, you eventually need to make changes to that API without disrupting callers of your API. It's also useful to let developers know about the changes you made.

In Azure API Management, use revisions to make nonbreaking API changes. You can model and test changes safely. When ready, make your revision current and replace the current API.

For more information, see Versions and Revisions.

Tip

API teams can use this feature in workspaces. Workspaces provide isolated administrative access to APIs and their own API runtime environments.

In this tutorial, you learn how to:

  • Add a new revision
  • Make nonbreaking changes to your revision
  • Make your revision current and add a change log entry
  • Browse the developer portal to see changes and change log
  • Access an API revision

Screenshot of API revisions in the Azure portal.

Prerequisites

Add a new revision

  1. Sign in to the Azure portal, and go to your API Management instance.

  2. In the left menu, under APIs, select APIs.

  3. Select Swagger Petstore from the API list, or a different API to which you want to add revisions.

  4. Select the Revisions tab.

  5. Select + Add revision.

    Screenshot of adding an API revision in the portal.

    Tip

    You can also select Add revision in the context menu (...) of the API.

  6. Provide a description for your new revision, to help remember what it's used for.

  7. Select Create.

    Your new revision is now created.

    Note

    Your original API remains in Revision 1. This one is the revision your users continue to call, until you choose to make a different revision current.

Make nonbreaking changes to your revision

  1. Select Swagger Petstore from the API list.

  2. Select Design near the top of the screen.

    The revision selector above the design tab shows Revision 2 as currently selected.

    Tip

    Use the revision selector to switch between revisions that you wish to work on.

  3. Select + Add Operation.

  4. Set your new operation to POST, and the Display name, Name, and URL of the operation as test.

  5. Save your new operation.

    Screenshot showing how to add an operation in a revision in the portal.

    You've now made a change to Revision 2.

  6. Use the revision selector near the top of the page to switch back to Revision 1.

    Notice that your new operation doesn't appear in Revision 1.

Make your revision current and add a change log entry

  1. From the menu near the top of the page, select Revisions.

  2. Open the context menu (...) for Revision 2.

  3. Select Make current.

  4. If you want to post notes about this change, select Post to Public Change log for this API. Provide a description for your change that the developers can see, for example: Testing revisions. Added new "test" operation.

    Revision 2 is now current.

    Screenshot of revision menu in Revisions window in the portal.

Browse the developer portal to see changes and change log

If you try the developer portal, you can review the API changes and change log there.

  1. In the Azure portal, navigate to your API Management instance.
  2. In the left menu, under APIs, select APIs.
  3. Select Developer portal from the top menu.
  4. In the developer portal, select APIs, and then select Swagger Petstore.
  5. Notice your new test operation is now available.
  6. Select Change log near the API name.
  7. Notice that your change log entry appears in the list.

Access an API revision

Each revision to your API can be accessed using a specially formed URL. Add ;rev={revisionNumber} at the end of your API URL path, but before the query string, to access a specific revision of that API. For example, you might use a URL similar to the following to access revision 2 of the Swagger Petstore API:

https://apim-hello-world.azure-api.net/store/pet/1;rev=2/

You can find the URL paths for your API's revisions on the Revisions tab in the Azure portal.

Screenshot of revision URLs in the portal.

Tip

You can access the current revision of your API using the API path without the ;rev string, in addition to the full URL that appends ;rev={revisionNumber} to your API path.

Summary

In this tutorial, you learned how to:

  • Add a new revision
  • Make nonbreaking changes to your revision
  • Make your revision current and add a change log entry
  • Browse the developer portal to see changes and change log
  • Access an API revision

Next step

Advance to the next tutorial: