AZ-400 Develop a security and compliance plan Practice Question
This AZ-400 practice question tests your understanding of develop a security and compliance plan. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. 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
Refer to the exhibit.
```json
{
"alertRule": {
"displayName": "Key Vault Secret Near Expiry",
"query": "// Azure Resource Graph query
resources
| where type == 'microsoft.keyvault/vaults/secrets'
| extend DaysToExpiry = datetime_diff('day', now(), properties.attributes.expiresOn)
| where DaysToExpiry < 30 and DaysToExpiry > 0
| project name, vaultName = resourceGroup, expiresOn = properties.attributes.expiresOn, DaysToExpiry
| limit 10"
}
}
```
The exhibit shows a draft Azure Monitor alert rule for Key Vault secret expiry. However, the query fails to return results for secrets that have already expired. What is the most likely reason?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The condition `DaysToExpiry > 0` excludes secrets that have already expired.
Option B is correct because the query filters on `DaysToExpiry > 0`, which only returns secrets with a positive number of days remaining until expiry. Once a secret has expired, its `DaysToExpiry` becomes zero or negative, so it is excluded from the results. This is a logical filter error: the condition should be `DaysToExpiry <= 0` or remove the filter entirely to include expired secrets.
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.
✗
The query does not include secrets that have no expiry date set.
Why it's wrong here
This would affect secrets without expiry, not expired ones.
✓
The condition `DaysToExpiry > 0` excludes secrets that have already expired.
Why this is correct
Expired secrets have negative DaysToExpiry, so they are filtered out.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
✗
The query only checks secrets that are enabled.
Why it's wrong here
The query does not include a filter for enabled status.
✗
The `limit 10` clause restricts to only 10 secrets, which may miss expired ones.
Why it's wrong here
The limit does not prevent expired secrets from appearing if they are within the first 10 results.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates focus on the syntax or limits of the query (like `limit 10`) rather than recognizing that the logical filter `DaysToExpiry > 0` inherently excludes the very data the alert is supposed to detect—expired secrets.
Detailed technical explanation
How to think about this question
In Azure Monitor log queries for Key Vault, the `DaysToExpiry` property is calculated as the difference between the current time and the secret's expiration date, expressed in days. When a secret expires, this value becomes negative (or zero at the exact moment of expiry). The condition `DaysToExpiry > 0` is a common mistake because it treats expiry as a future event only, ignoring the need to alert on secrets that have already passed their expiration date. A correct query for expired secrets would use `DaysToExpiry <= 0` or `DaysToExpiry < 1` to capture both current and past expiry states.
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-400 question in full detail.
Develop a security and compliance plan — This question tests Develop a security and compliance plan — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The condition `DaysToExpiry > 0` excludes secrets that have already expired. — Option B is correct because the query filters on `DaysToExpiry > 0`, which only returns secrets with a positive number of days remaining until expiry. Once a secret has expired, its `DaysToExpiry` becomes zero or negative, so it is excluded from the results. This is a logical filter error: the condition should be `DaysToExpiry <= 0` or remove the filter entirely to include expired secrets.
What should I do if I get this AZ-400 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
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-400 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-400 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.