AZ-104 Monitor and Maintain Azure Resources Practice Question
A support engineer needs to search a Log Analytics workspace for only failed sign-in records. Which KQL query should they use?
⚠ Common exam trap
The trap here is that candidates may mistakenly think `ResultType == 0` indicates a failure, when in fact 0 means success, and they overlook that non-zero values represent various failure codes.
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
✓
SigninLogs | where ResultType != 0
In Azure AD sign-in logs, a `ResultType` of 0 indicates a successful sign-in, while any non-zero value (e.g., 50125, 53003) indicates a failure. The KQL query `SigninLogs | where ResultType != 0` filters for all records where the result type is not zero, thus returning only failed sign-in records.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
SigninLogs | where ResultType == 0
Why it's wrong here
This query filters for ResultType equal to 0, which in the SigninLogs schema specifically denotes a successful sign-in attempt. As a result, it returns only the success records and excludes every failure, which is the opposite of what the support engineer needs. The correct approach is to look for any non-zero ResultType, since failed sign-ins are indicated by a variety of error codes.
When this WOULD be correct
If the question asked to find only successful sign-in records, then 'SigninLogs | where ResultType == 0' would be correct, as ResultType 0 typically represents success.
- ✓
SigninLogs | where ResultType != 0
Why this is correct
This query correctly isolates failed sign-ins because in the SigninLogs table a ResultType value of 0 (or "0") indicates a successful authentication, while all non-zero values represent error codes such as 50126 (invalid credentials) or 50053 (account lockout). By applying a where clause that excludes zero, you return only the failed sign-in events. Note that the ResultType field may be stored as a string, so the comparison might need quotes in some query contexts, but the logical predicate is correct.
- ✗
SigninLogs | summarize count()
Why it's wrong here
The summarize count() operator performs a full-table aggregation, collapsing every row in SigninLogs into a single count of records, and it applies no filter on ResultType whatsoever. This means the output tells you how many sign-in logs exist, but it does not differentiate successful events from failed ones. To identify failures you would first need a where clause to narrow the dataset, and then you could summarize—but the summarized count alone is useless for this task.
When this WOULD be correct
A question asks: 'Which KQL query returns the total number of sign-in records in the Log Analytics workspace?' Then SigninLogs | summarize count() would be correct.
- ✗
SigninLogs | project UserPrincipalName
Why it's wrong here
The project operator is used to limit the output to a single column, UserPrincipalName, which merely changes the result set's shape by removing other fields from view. It performs no row-level filtering, so all sign-in records, both successful and failed, remain in the results. To find failed sign-ins, you need a where predicate that checks the ResultType column, not a projection of user names.
When this WOULD be correct
If the question asked: 'Which KQL query returns only the user principal names from sign-in logs?' then this option would be correct because it selects a single column.
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.
✓SigninLogs | where ResultType != 0Correct answer▾
Why this is correct
This query correctly isolates failed sign-ins because in the SigninLogs table a ResultType value of 0 (or "0") indicates a successful authentication, while all non-zero values represent error codes such as 50126 (invalid credentials) or 50053 (account lockout). By applying a where clause that excludes zero, you return only the failed sign-in events. Note that the ResultType field may be stored as a string, so the comparison might need quotes in some query contexts, but the logical predicate is correct.
✗SigninLogs | where ResultType == 0Wrong answer — click to see why▾
Why this is wrong here
ResultType == 0 indicates successful sign-ins, not failed ones. The question specifically asks for failed sign-in records, so this filter excludes the desired data.
★ When this WOULD be the correct answer
If the question asked to find only successful sign-in records, then 'SigninLogs | where ResultType == 0' would be correct, as ResultType 0 typically represents success.
Why candidates choose this
Candidates may mistakenly think 0 represents a failure code or confuse the result type values, assuming 0 means 'no success' or 'error'.
✗SigninLogs | summarize count()Wrong answer — click to see why▾
Why this is wrong here
The query uses summarize count() which returns the total count of sign-in records, not filtered for failed sign-ins. It does not include a where clause to isolate failed sign-ins (ResultType != 0).
★ When this WOULD be the correct answer
A question asks: 'Which KQL query returns the total number of sign-in records in the Log Analytics workspace?' Then SigninLogs | summarize count() would be correct.
Why candidates choose this
Candidates may think summarize count() is needed to count failed sign-ins, but they forget to apply a filter first, or they confuse summarizing with filtering.
✗SigninLogs | project UserPrincipalNameWrong answer — click to see why▾
Why this is wrong here
The query projects only the UserPrincipalName column, which does not filter for failed sign-ins (ResultType != 0) and omits the ResultType column needed to identify failures.
★ When this WOULD be the correct answer
If the question asked: 'Which KQL query returns only the user principal names from sign-in logs?' then this option would be correct because it selects a single column.
Why candidates choose this
Candidates may think 'project' is used to filter rows, confusing column selection with row filtering, or they might assume that showing user names inherently implies failed sign-ins.
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
Learn chapter
Managed Identities for Azure Resources
Key term
KQL
Kusto Query Language is a powerful read-only query language used to explore, analyze, and visualize large datasets, most notably in Azure Data Explorer and Microsoft Sentinel.
Key term
Log Analytics workspace
A Log Analytics workspace is a unique environment in Azure Monitor where log data from various sources is collected, stored, and queried for analysis and reporting.
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.