A DevOps team is responsible for a critical Azure Function App. They need to create an alert that triggers when the average response time of the HTTP trigger function exceeds 500 milliseconds for a continuous period of 5 minutes. The alert should send an email to the operations team and also post a message to a Microsoft Teams channel. Which sequence of actions correctly creates this alert in Azure Monitor?
- ACreate an activity log alert rule > Select 'Function App Down' signal > Configure severity > Add 'SMS' action group.
- BCreate a metric alert rule > Select 'Function Http Response Time' metric > Configure 'Average' aggregation, '5 minutes' granularity, and '500 ms' threshold > Create an action group with 'Email' and 'Microsoft Teams' actions.
- CCreate a metric alert rule > Select 'Function Execution Count' metric > Configure threshold and aggregation > Add 'Email' action group.
- DCreate a log alert rule > Write a KQL query for 'FunctionAppLogs' > Configure threshold and frequency > Add 'Webhook' action group for Teams.
Show answer & explanationAnswer & explanation
Correct answer: B. Create a metric alert rule > Select 'Function Http Response Time' metric > Configure 'Average' aggregation, '5 minutes' granularity, and '500 ms' threshold > Create an action group with 'Email' and 'Microsoft Teams' actions.
To alert on response time, a metric alert rule is required. The 'Function Http Response Time' metric directly measures this, and configuring 'Average' aggregation over a '5 minutes' granularity with a '500 ms' threshold precisely matches the requirement. An action group can combine email and Teams notifications.
Why the other options are wrong
- A. Activity log alerts are for resource-level events (like resource creation/deletion), not application performance metrics. Also, SMS is not requested.
- C. This uses the wrong metric ('Execution Count' instead of 'Response Time') and misses the Teams action.
- D. While log alerts can be powerful, a direct metric for HTTP response time is more efficient and appropriate here. Also, webhooks can be used for Teams, but 'Microsoft Teams' is a direct action type in action groups.
Azure Monitor Metric Alerts
Alert rules that trigger when a numeric metric value crosses a specified threshold, based on various aggregations and time granularities.
- Used for performance and availability monitoring.
- Evaluates data from Azure Monitor Metrics.
- Supports various action types via action groups (email, SMS, webhooks, Teams, etc.).
Memory trick: Metrics for performance, logs for deep dive, activity for resource changes.