You are developing an Azure Function App that processes business orders. You configure the Function App to send telemetry to Application Insights. You must implement a monitoring solution using Azure Monitor to meet the following requirements:
- Automatically notify the operations team via email if any function execution takes longer than 10 seconds to complete.
- Execute a custom Azure Function to log details of the slow execution to an external auditing database.
- Optimize the alert query performance and minimize data scan costs.
Which two actions should you perform? (Choose two.)
- Create a log search alert rule with a query that filters the requests table using: `requests | where timestamp > ago(5m) and duration > 10000`Answer
- Create an action group containing an Email receiver to notify the operations team and an Azure Function receiver to invoke the logging functionAnswer
- CCreate a log search alert rule with a query that filters the requests table using: `requests | where duration > 10000`
- DConfigure the alert rule target scope using only the Application Insights instrumentation key string instead of the resource ID of the workspace or App Service
Answer
To meet the requirements, you must create a log search alert rule with a time-filtered KQL query (`requests | where timestamp > ago(5m) and duration > 10000`) and configure an action group that contains an Email receiver and an Azure Function receiver.
The correct actions involve configuring a Log Search alert rule that queries the `requests` table with a restricted time range (`timestamp > ago(5m)`) to maintain high performance and low costs, while detecting request durations greater than 10 seconds (`duration > 10000`). Additionally, you must configure an action group containing both an Email receiver to alert the operations team and an Azure Function receiver to execute the custom logging database logic.
Step-by-Step Solution
Key Concept
Implementing Log Search Alerts with KQL and configuring Action Groups with diverse receivers (Email and Azure Functions) in Azure Monitor.