AZ-104 Monitor and Maintain Azure Resources Practice Question
Exhibit
CustomAppLogs_CL sample rows: TimeGenerated Status_s Component_s Message 2026-04-24T08:00:00Z Failed api timeout 2026-04-24T08:03:00Z Failed api timeout 2026-04-24T08:05:00Z Success api ok 2026-04-24T08:07:00Z Failed api auth error 2026-04-24T08:09:00Z Failed api auth error 2026-04-24T08:11:00Z Failed api auth error The alert must trigger when at least 5 failed events occur in any 15-minute window.
Based on the exhibit, which KQL query should you use in a scheduled query alert to trigger only when five or more failed events occur within any 15-minute window?
⚠ Common exam trap
Watch out — candidates often confuse the lookback period (`ago(1h)`) with the aggregation window (`bin(..., 15m)`), leading them to pick Option A with a 1-hour bin, which fails to meet the 'any 15-minute window' requirement.
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
✓
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5
It filters for 'Failed' events in the last hour, groups them into 15-minute bins using `bin(TimeGenerated, 15m)`, and then counts them. The `where FailedCount >= 5` condition triggers the alert only when five or more failed events occur within any single 15-minute window, matching the requirement exactly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
CustomAppLogs_CL | where TimeGenerated >= ago(15m) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 1h) | where FailedCount >= 5
Why it's wrong here
Here the time filter uses ago(15m), but the bin size is set to 1h. Because the bin is larger than the query window, all events fall into the same bucket, so the query cannot identify distinct 15-minute periods and effectively measures only a single aggregate over the last quarter hour. This misalignment with the intended evaluation window makes it unsuitable for an alert that should react to 15-minute failure bursts.
When this WOULD be correct
This query would be correct if the alert required five or more failed events within any 1-hour window, with the time range also set to 1 hour.
- ✓
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5
Why this is correct
This query correctly scopes the evaluation to the last hour, applies a precise filter on Status_s to include only failed events, then aggregates the count into 15-minute bins using bin(TimeGenerated, 15m). The final where clause enforces the required threshold of five or more failures per bin, ensuring the alert fires only when the exact condition is satisfied.
- ✗
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5
Why it's wrong here
The query omits the filter on Status_s, so it counts every event in the logs, including successes and other statuses. Consequently, a bin could reach FailedCount >= 5 even if there are zero actual failures, or the count may be inflated by non-failed events, making the alert semantically incorrect. A proper alert query must isolate the failure condition before aggregation.
When this WOULD be correct
This query would be correct if the question asked to trigger an alert when five or more total events (regardless of status) occur within any 15-minute window, and the status field was irrelevant.
- ✗
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount > 0
Why it's wrong here
This query correctly filters for failed events over the last hour and groups them into 15-minute bins, but the final condition uses FailedCount > 0 instead of >= 5. As a result, it would trigger on any bin with even a single failure, causing excessive alerts that do not reflect the requirement of five or more failures. The threshold must match the alert rule's definition.
When this WOULD be correct
This query would be correct if the requirement was to trigger an alert whenever any failed event occurs within a 15-minute window (i.e., threshold of at least one failure).
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.
✓CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5Correct answer▾
Why this is correct
This query correctly scopes the evaluation to the last hour, applies a precise filter on Status_s to include only failed events, then aggregates the count into 15-minute bins using bin(TimeGenerated, 15m). The final where clause enforces the required threshold of five or more failures per bin, ensuring the alert fires only when the exact condition is satisfied.
✗CustomAppLogs_CL | where TimeGenerated >= ago(15m) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 1h) | where FailedCount >= 5Wrong answer — click to see why▾
Why this is wrong here
The query uses a 1-hour bin size, so it counts failed events per hour, not per 15-minute window. This would not trigger correctly for five or more failures within any 15-minute period.
★ When this WOULD be the correct answer
This query would be correct if the alert required five or more failed events within any 1-hour window, with the time range also set to 1 hour.
Why candidates choose this
Candidates may mistakenly think that using a larger bin size (1h) still captures the 15-minute requirement, or they overlook the bin size parameter and focus only on the count threshold.
✗CustomAppLogs_CL | where TimeGenerated >= ago(1h) | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5Wrong answer — click to see why▾
Why this is wrong here
The query does not filter for 'Failed' events (missing `where Status_s == 'Failed'`), so it counts all events, not just failed ones, making the alert trigger incorrectly.
★ When this WOULD be the correct answer
This query would be correct if the question asked to trigger an alert when five or more total events (regardless of status) occur within any 15-minute window, and the status field was irrelevant.
Why candidates choose this
Candidates may overlook the need to filter by status, assuming the count is already limited to failed events, or they might mistakenly think the query is equivalent to option B.
✗CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount > 0Wrong answer — click to see why▾
Why this is wrong here
The query filters for `FailedCount > 0`, which includes any window with at least one failure, not specifically five or more. The alert would trigger on any failed event, not only when five or more occur.
★ When this WOULD be the correct answer
This query would be correct if the requirement was to trigger an alert whenever any failed event occurs within a 15-minute window (i.e., threshold of at least one failure).
Why candidates choose this
Candidates may mistakenly think that `FailedCount > 0` is equivalent to `FailedCount >= 5` because they focus on the aggregation and binning but overlook the specific threshold condition.
Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
About these practice questions
One of 1,049 original AZ-104 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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-104 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-104 exam.