The answer is that the policy does not check whether the NSG is actually associated with the resource. While the existenceCondition correctly verifies that an NSG exists with a rule named containing 'Allow', it only confirms the NSG resource itself meets the criteria, not that it is attached to the subnet or NIC of the virtual network or virtual machine being deployed. This is a critical gap because an NSG can exist in the subscription without being associated, so the policy’s 'if' condition—which merely checks the resource type—will pass even when no NSG is linked to the target resource. On the Microsoft Azure Solutions Architect Expert AZ-305 exam, this tests your understanding of how Azure Policy evaluates resource properties versus associations, a common trap where candidates confuse resource existence with resource attachment. Remember the key distinction: existenceCondition checks for the presence of a resource, but association requires a separate property like networkSecurityGroup.id on a subnet or NIC. Memory tip: “Exists is not attached—check the link, not just the thing.”
AZ-305 Design infrastructure solutions Practice Question
This AZ-305 practice question tests your understanding of design infrastructure solutions. 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.
Refer to the exhibit. You are reviewing an Azure Policy definition that your team plans to assign. The policy is intended to deny the deployment of virtual networks and virtual machines if they do not have an NSG attached with a rule named containing 'Allow'. However, the policy is not working as expected. 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 policy does not check whether the NSG is actually associated with the resource.
Option C is correct because the existenceCondition checks the NSG rule name on the NSG resource, but the policy's 'if' condition only checks the resource type. The policy does not ensure that the NSG is associated with the subnet or NIC; an NSG can exist without being attached. Option A is wrong because the policy syntax is valid. Option B is wrong because 'deny' is a valid effect. Option D is wrong because the policy rule does not use aliases incorrectly.
Key principle: Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.
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 field 'Microsoft.Network/networkSecurityGroups/securityRules[*].name' is an incorrect alias.
Why it's wrong here
The alias is correct for rule names.
✓
The policy does not check whether the NSG is actually associated with the resource.
Why this is correct
The policy checks for the existence of an NSG with a rule name but does not verify association.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
The syntax appears valid; it uses proper JSON structure.
✗
The effect 'deny' cannot be used with existenceCondition.
Why it's wrong here
'deny' can be used with existenceCondition.
Common exam traps
Common exam trap: usable hosts are not the same as total addresses
Subnetting questions often tempt you into counting all addresses. In normal IPv4 subnets, the network and broadcast addresses are not usable host addresses.
Detailed technical explanation
How to think about this question
Subnetting questions test whether you can identify the network, broadcast address, usable range, mask and correct subnet. Slow down enough to calculate the block size correctly.
KKey Concepts to Remember
CIDR notation defines the prefix length.
Block size helps identify subnet boundaries.
Network and broadcast addresses are not usable hosts in normal IPv4 subnets.
The required host count determines the smallest suitable subnet.
TExam Day Tips
→Write the block size before choosing the subnet.
→Check whether the question asks for hosts, subnets or a specific address range.
→Do not confuse /24, /25, /26 and /27 host counts.
Key takeaway
Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this AZ-305 question in full detail.
Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related AZ-305 subnetting questions on CIDR, address ranges, and subnet selection.
Design infrastructure solutions — This question tests Design infrastructure solutions — CIDR notation defines the prefix length..
What is the correct answer to this question?
The correct answer is: The policy does not check whether the NSG is actually associated with the resource. — Option C is correct because the existenceCondition checks the NSG rule name on the NSG resource, but the policy's 'if' condition only checks the resource type. The policy does not ensure that the NSG is associated with the subnet or NIC; an NSG can exist without being attached. Option A is wrong because the policy syntax is valid. Option B is wrong because 'deny' is a valid effect. Option D is wrong because the policy rule does not use aliases incorrectly.
What should I do if I get this AZ-305 question wrong?
Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related AZ-305 subnetting questions on CIDR, address ranges, and subnet selection.
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?
CIDR notation defines the prefix length.
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-305 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-305 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.