AZ-204 Practice Question: Azure Monitor metric alert for 5xx error rate…
The team needs to receive an email when an App Service's HTTP 5xx error rate exceeds 5 percent for more than five consecutive minutes. No custom code should be written. What combination of Azure Monitor features implements this requirement?
⚠ Common exam trap
Watch out — candidates often confuse metric alerts (which work on platform metrics like Http5xxErrors) with log alerts (which require querying diagnostic logs), or mistakenly think Application Insights availability tests are the correct tool for server-side error monitoring.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create a log alert that queries the App Service diagnostic log table every 5 minutes and emails the team if the 5xx count exceeds a threshold
The explanation incorrectly states that a 5% threshold on the 'Http5xxErrors' metric can directly represent a 5% error rate. This metric is a count, and standard metric alerts do not provide a built-in mechanism to calculate its percentage relative to total requests. To achieve the required 'rate' calculation, a log alert with a Kusto Query Language (KQL) query is necessary to compute the ratio of 5xx errors to total requests over the specified time window. KQL queries within log alerts are considered configuration, not custom code, thus meeting all requirements.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a metric alert on the Http5xxErrors metric with a 5-percent threshold, a 5-minute evaluation window, and an action group that sends email
Why it's wrong here
App Service emits Http5xxErrors as a platform metric. A metric alert configured with a 5-percent threshold and a PT5M evaluation window checks the condition every minute and fires after the threshold is breached continuously for 5 minutes. The action group routes the alert to the team's email.
- ✓
Create a log alert that queries the App Service diagnostic log table every 5 minutes and emails the team if the 5xx count exceeds a threshold
Why this is correct
A log alert querying every five minutes evaluates conditions within that specific interval, not sustained breaches over consecutive periods. This fails the "more than five consecutive minutes" requirement, which demands a stateful evaluation over time. Log alerts are suitable for detecting specific event patterns or simple aggregate counts in logs within a single evaluation window, making them tempting for error detection. They would be correct if the requirement was to alert on a 5xx rate exceeding a threshold in any given five-minute period, without needing to track consecutive violations.
- ✗
Enable Application Insights availability tests and configure an alert on test failure rate
Why it's wrong here
Availability tests simulate user traffic by sending synthetic requests from various global locations. While they are excellent for detecting service downtime or network reachability issues, they do not measure the actual HTTP 5xx error rate experienced by real users interacting with the application. A high 5xx rate from real user traffic could occur even if availability tests pass, as the tests might not hit the specific code paths or data causing the errors. Therefore, this approach fails to meet the requirement of monitoring real user-experienced 5xx errors.
- ✗
Configure a diagnostic setting to stream logs to Azure Storage, then write a Function that reads the storage file and sends email when errors are found
Why it's wrong here
This solution involves creating a complex, custom data pipeline that streams diagnostic logs to Azure Storage, then requires a separate Azure Function to parse these logs and trigger alerts. While technically feasible, it introduces significant operational overhead, increased latency for alert delivery, and higher costs compared to native Azure Monitor capabilities. Azure Monitor's platform metrics and built-in alerting mechanisms are specifically designed for this scenario, offering a more efficient, reliable, and cost-effective solution without requiring custom code or infrastructure.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.