Debug your APIs using request tracing

This tutorial describes how to inspect request processing to help you with debugging and troubleshooting your API.

In this tutorial, you learn how to:

  • Trace a call

API inspector

Prerequisites

To navigate to your APIM instance, follow these steps:

  1. Sign in to the Azure portal.
  2. Select arrow.
  3. Type "api" in the search box.
  4. Click API Management services.

    Navigate

  5. Select your APIM service instance.

Tip

Add API Management (APIM) to your favorites in the Azure portal by clicking the star.
This adds the APIM icon to the menu on the left of the portal. To see all your APIM services, click the icon (APIM icon).

Trace a call

  1. Select APIs.
  2. Click Demo Conference API from your API list.
  3. Select GetSpeakers operation.
  4. Switch to the Test tab.
  5. Make sure to include an HTTP header named Ocp-Apim-Trace with the value set to true.
  6. Click "Send" to make an API call.
  7. Wait for the call to complete.
  8. Go to the Trace tab in the API console. You can click any of the following links to jump to detailed trace info: inbound, backend, outbound.

    In the inbound section, you see the original request API Management received from the caller and all the policies applied to the request including the rate-limit and set-header policies we added in step 2.

    In the backend section, you see the requests API Management sent to the API backend and the response it received.

    In the outbound section, you see all the policies applied to the response before sending back to the caller.

    Tip

    Each step also shows the elapsed time since the request is received by API Management.

Next steps

In this tutorial, you learned how to:

  • Trace a call

Advance to the next tutorial: