Question

Difficulty: MediumProvision and Configure Azure API Management

An organization has deployed a set of backend microservices. You are provisioning a new Azure API Management (APIM) instance to act as a gateway for these services. You need to configure APIM to send diagnostic telemetry, including request and response details, to an Azure Application Insights instance. What should you do to configure the integration between API Management and Application Insights?

  1. Create an API Management logger resource that references the Application Insights instance, and then configure the diagnostics settings at the API or global level to use that logger.Answer
  2. B
    Add the Application Insights connection string to the Application Settings of the backend App Services, as API Management automatically inherits telemetry settings from its backend services.
  3. C
    Place a custom track-request policy containing the Application Insights instrumentation key in the inbound policy section of each API.
  4. D
    Grant the API Management system-assigned managed identity Key Vault secrets GET permissions and configure a Key Vault reference in the API Management App Settings to automatically stream Gateway logs.

Answer

Create an API Management logger resource that references the Application Insights instance, and then configure the diagnostics settings at the API or global level to use that logger.
To integrate Azure API Management with Application Insights, you must create a logger resource in API Management pointing to the Application Insights instance. Once the logger is created, you configure the API Management diagnostics settings to use the logger, which starts streaming request and response telemetry.

Step-by-Step Solution

1
Retrieve the instrumentation key or connection string of the target Application Insights instance.
The configuration details required for authentication are obtained.
API Management needs these details to authenticate and send telemetry to Application Insights.
2
Create a logger resource in Azure API Management pointing to the Application Insights instance.
A logger resource of type Microsoft.ApiManagement/service/loggers is created in APIM.
This registers the Application Insights telemetry channel within the APIM service.
3
Configure the diagnostics settings at either the global level or for individual APIs to use the created logger.
Telemetry logging is enabled and requests/responses are streamed to Application Insights.
This activates the streaming of gateway logs using the defined logger.

Key Concept

API Management Integration with Application Insights
Rate this question