The correct answer is the query that uses `bin(TimeGenerated, 15m)` to group events into 15-minute windows and then filters for `FailedCount >= 5`. This works because the `bin()` function creates fixed, non-overlapping time buckets, allowing the alert to evaluate whether five or more failed events occurred within any single 15-minute period, not just a rolling count. On the AZ-104 exam, this tests your ability to distinguish between time-window aggregation and simple time filtering—a common trap is using `ago(15m)` in the initial `where` clause, which only looks at the last 15 minutes as a single block, missing the “any window” requirement. Remember that `bin()` is your tool for sliding or fixed windows, while `ago()` is just a starting point. A quick memory tip: “Bin to bin, then count to count”—always bin your timestamps before summarizing counts to match window-based alert conditions.
AZ-104 Monitor and Maintain Azure Resources Practice Question
This AZ-104 practice question tests your understanding of monitor and maintain azure resources. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
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?
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.
A
CustomAppLogs_CL | where TimeGenerated >= ago(15m) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 1h) | where FailedCount >= 5
Why wrong: This query uses a one-hour bin, which is too large for a 15-minute alert condition. It also ignores failures outside the last 15 minutes only partially matching the requirement.
B
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5
This query filters to the recent hour, keeps only failed events, groups them into 15-minute bins, and returns only bins with five or more failures. That matches the alert requirement directly.
C
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5
Why wrong: This query counts every event, including successful ones, so it can trigger even when there are not five failures. The failure condition is missing.
D
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount > 0
Why wrong: This query would return any 15-minute bin with at least one failure, which is far too sensitive. The requirement is five or more failures, not just one.
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
Option B is correct because 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.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
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
This query uses a one-hour bin, which is too large for a 15-minute alert condition. It also ignores failures outside the last 15 minutes only partially matching the requirement.
✓
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 filters to the recent hour, keeps only failed events, groups them into 15-minute bins, and returns only bins with five or more failures. That matches the alert requirement directly.
Related concept
Read the scenario before looking for a memorised answer.
✗
CustomAppLogs_CL | where TimeGenerated >= ago(1h) | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5
Why it's wrong here
This query counts every event, including successful ones, so it can trigger even when there are not five failures. The failure condition is missing.
✗
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 would return any 15-minute bin with at least one failure, which is far too sensitive. The requirement is five or more failures, not just one.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that 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.
Detailed technical explanation
How to think about this question
The `bin()` function in KQL creates fixed-size time buckets; for a 15-minute window, `bin(TimeGenerated, 15m)` aligns events to the nearest 15-minute boundary (e.g., 00:00, 00:15, 00:30). In a scheduled query alert, the `ago(1h)` lookback ensures the query evaluates the last hour of data, but the bin size controls the aggregation window—critical for detecting bursts of failures. A real-world scenario is monitoring authentication failures: using a 1-hour bin might miss a spike of five failures in 10 minutes, while a 15-minute bin captures it accurately.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this AZ-104 question in full detail.
Monitor and Maintain Azure Resources — This question tests Monitor and Maintain Azure Resources — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: CustomAppLogs_CL | where TimeGenerated >= ago(1h) | where Status_s == 'Failed' | summarize FailedCount=count() by bin(TimeGenerated, 15m) | where FailedCount >= 5 — Option B is correct because 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.
What should I do if I get this AZ-104 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.