แก้ไข

แชร์ผ่าน


Enable logging of developer portal usage in Azure API Management

APPLIES TO: Developer | Basic | Standard | Premium

This article shows you how to enable Azure Monitor logs for auditing and troubleshooting usage of the API Management developer portal. When enabled through a diagnostic setting, the logs collect information about the requests that are received and processed by the developer portal.

Developer portal usage logs include data about activity in the developer portal, including:

  • User authentication actions, such as sign-in and sign-out
  • Views of API details, API operation details, and products
  • API testing in the interactive test console

Enable diagnostic setting for developer portal logs

To configure a diagnostic setting for developer portal usage logs:

  1. In the Azure portal, navigate to your API Management instance.

  2. In the left menu, under Monitoring, select Diagnostic settings > + Add diagnostic setting.

    Screenshot of adding a diagnostic setting in the portal.

  3. On the Diagnostic setting blade, enter or select details for the setting:

    1. Diagnostic setting name: Enter a descriptive name.
    2. Category groups: Optionally make a selection for your scenario.
    3. Under Categories: Select Logs related to Developer Portal usage. Optionally select other categories as needed.
    4. Under Destination details, select one or more options and specify details for the destination. For example, archive logs to a storage account or stream them to an event hub. Learn more
    5. Select Save.

View diagnostic log data

Depending on the log destination you choose, it can take a few minutes for data to appear.

If you send logs to a storage account, you can access the data in the Azure portal and download it for analysis.

  1. In the Azure portal, navigate to the storage account destination.
  2. In the left menu, select Storage Browser.
  3. Under Blob containers, select insights-logs-developerportalauditlogs.
  4. Navigate to the container for the logs in your API Management instance. The logs are partitioned in intervals of 1 hour.
  5. To retrieve the data for further analysis, select Download.