Set up Azure API Management Service logging

Created:
November 7, 2023
Updated:
September 19, 2024

The Azure API Management Service logging integration with FireTail enables you to track and analyze API traffic by capturing detailed logs of both requests and responses. These logs are centralized in the FireTail platform, giving you insights into API usage and performance.

To set up the integration, you’ll need to select your Azure API Management service, generate an application token, and deploy a pre-configured template. This template applies policies to capture and send logs to FireTail, which can be applied globally or to specific APIs.

Note: You must have an Azure API Management service set up before configuring the logging integration. During the process, your APIs are added to the service, and the necessary policies are applied.

Follow the steps below to complete the template and deploy the resources needed for the integration.

1. Select the API management Service from the dropdown.

2. Create an App token and copy it for later use.

3. Click Deploy to Azure. This will open up a template which will deploy all the required resources to set up the logging.

4. Select a Resource Group from the dropdown. This needs to be the same resource group as your API gateway service. When you select the resource group the region is populated. 

5. The app name is pre-filled, but can be edited if required

6. Select the App Service Plan from the dropdown.Click here to view what the service plans are.  

7. Enter an Event Hub Namespace Name, this name must be unique.

8. In the Apim Service Name field enter the name of the Azure API Management service. The name can be located in the API management services page.

9. Copy the FireTail app token that you generated in step 2. Paste into the FireTail App Token field.

10. Click NextCreate.

This will initiate the deployment. The deployment may take a couple of minutes to be completed. When it is done you can then add the policy.

Add a policy

1. In the FireTail platform, copy the policy in the integration setup.

2. Go to the Azure API management services page. Select the API management service the integration is being applied to. Select APIs from the left menu.

3. Apply the policy. You can add the policy globally, to a specific API, or to a specific operation.

  • To apply the policy globally:
    • Click All APIs. In the Inbound processing section, click the code editor symbol (</>).
    •   Remove the existing policy and paste the FireTail policy into the code editor.
    •   Note: The base element must be removed from the policy when it is applied to all APIs.
  • To apply the policy to an API:
    • Click the required API. In the Inbound processing section, click the code editor symbol (</>).
    • Remove the existing policy and paste the FireTail policy into the code editor.
  • To apply the policy to an operation:
    • Click the required API. In the Inbound processing section, click the code editor symbol (</>).
    •  Remove the existing policy and paste the FireTail policy into the code editor.

4. Click Save.

When the deployment is complete and the policies added, you will get logs for the relevant APIs in the FireTail platform.