Question

Difficulty: MediumImplement Azure Monitor Alerts and Action Groups

You are implementing an end-to-end monitoring and alerting solution for a new API hosted on Azure. You must configure the API to send telemetry to Application Insights, write an efficient Kusto Query Language (KQL) query to analyze exception trends over the past day, and configure an Azure Monitor Action Group to trigger a webhook that requires an API key stored in Azure Key Vault.

Which combination of configurations should you implement to meet these requirements?

  1. A
    Enable the Application Insights SDK in the API code without configuring the connection string, include where timestamp>ago(24h)\text{where timestamp} > \text{ago}(24\text{h}) in the KQL troubleshooting query, and assign the Key Vault Secrets User role to the Action Group's managed identity.
  2. Configure the API environment variable APPLICATIONINSIGHTS_CONNECTION_STRINGAPPLICATIONINSIGHTS\_CONNECTION\_STRING to send telemetry, include where timestamp>ago(24h)\text{where timestamp} > \text{ago}(24\text{h}) in the KQL troubleshooting query, and assign the Key Vault Secrets User role to the Action Group's managed identity.Answer
  3. C
    Configure the API environment variable APPLICATIONINSIGHTS_CONNECTION_STRINGAPPLICATIONINSIGHTS\_CONNECTION\_STRING to send telemetry, omit the time filter from the KQL troubleshooting query, and assign the Key Vault Secrets User role to the Action Group's managed identity.
  4. D
    Configure the API environment variable APPLICATIONINSIGHTS_CONNECTION_STRINGAPPLICATIONINSIGHTS\_CONNECTION\_STRING to send telemetry, include where timestamp>ago(24h)\text{where timestamp} > \text{ago}(24\text{h}) in the KQL troubleshooting query, and configure the Action Group webhook without granting the Action Group's managed identity access to the Key Vault.

Answer

Configure the API environment variable APPLICATIONINSIGHTS_CONNECTION_STRINGAPPLICATIONINSIGHTS\_CONNECTION\_STRING to send telemetry, include where timestamp>ago(24h)\text{where timestamp} > \text{ago}(24\text{h}) in the KQL troubleshooting query, and assign the Key Vault Secrets User role to the Action Group's managed identity.
The correct implementation requires routing API telemetry via the APPLICATIONINSIGHTS_CONNECTION_STRINGAPPLICATIONINSIGHTS\_CONNECTION\_STRING setting, specifying a time range filter (such as where timestamp>ago(24h)\text{where timestamp} > \text{ago}(24\text{h})) to keep the troubleshooting KQL query efficient, and assigning the Key Vault Secrets User role to the Action Group's managed identity so it can securely fetch the webhook API key.

Step-by-Step Solution

1
Configure the API application settings with the correct connection string.
Telemetry data from the API starts flowing to the configured Application Insights resource.
Azure Monitor requires the connection string to route telemetry correctly; using SDK defaults without a connection string will not send logs.
2
Ensure all diagnostic and troubleshooting KQL queries include a time range filter like where timestamp>ago(24h)\text{where timestamp} > \text{ago}(24\text{h}).
The query scans only the last 2424 hours of logs, running efficiently and avoiding system scan limits.
Omitting a time filter in KQL queries leads to full table scans, resulting in slow query performance.
3
Grant the Action Group's managed identity the Key Vault Secrets User role on the Azure Key Vault.
The Action Group is authorized to retrieve the API key secret from Key Vault.
Without explicit Key Vault access policies or Role-Based Access Control (RBAC) permissions, the Action Group cannot retrieve the secret to authenticate the webhook call.

Key Concept

Configuring Azure Monitor alerts, telemetry ingestion via connection strings, query optimization, and securing action group webhook receivers with managed identities.
Estimated Time:1m 30s
Rate this question