The correct answer is that the virtual network creation fails because a subnet lacks an NSG. This happens because the Azure Policy uses a deny effect combined with an existenceCondition that checks every subnet in the virtual network; if any subnet is found without an associated Network Security Group, the condition evaluates to false, triggering the deny and blocking the entire deployment. On the AZ-500 exam, this scenario tests your understanding of how Azure Policy’s deny effect differs from audit or modify effects, and it commonly appears as a trap where you might mistakenly think the policy only audits or automatically creates an NSG. Remember that deny policies are evaluated at deployment time and will fail the resource creation outright—they do not retroactively fix or warn. A useful memory tip: “Deny on any subnet missing NSG means the whole VNet gets the DG” (denied gate).
AZ-500 Secure networking Practice Question
This AZ-500 practice question tests your understanding of secure networking. 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.
You are an Azure security engineer. Your team has assigned the Azure Policy shown in the exhibit. A developer creates a new virtual network with a subnet that does not have a Network Security Group (NSG) associated. What will happen when the policy is evaluated?
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The virtual network creation fails because a subnet lacks an NSG.
Option C is correct because the policy denies the creation of a virtual network if any subnet does not have an NSG associated. The existenceCondition checks that for each subnet, an NSG exists; if false, the deny effect is triggered, and the virtual network creation fails. Option A is wrong because the policy does not audit; it denies. Option B is wrong because the policy denies the entire virtual network deployment. Option D is wrong because the policy does not create an NSG automatically.
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.
✗
A default NSG is automatically associated with the subnet.
Why it's wrong here
Azure Policy does not auto-create resources.
✓
The virtual network creation fails because a subnet lacks an NSG.
Why this is correct
The deny effect prevents the deployment of the virtual network.
The virtual network is created, but the subnet is denied.
Why it's wrong here
The policy denies the entire virtual network if any subnet lacks an NSG.
✗
The virtual network is created, and a non-compliant alert is generated.
Why it's wrong here
The policy effect is 'deny', not 'audit'.
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-500 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-500 subnetting questions on CIDR, address ranges, and subnet selection.
Secure networking — This question tests Secure networking — CIDR notation defines the prefix length..
What is the correct answer to this question?
The correct answer is: The virtual network creation fails because a subnet lacks an NSG. — Option C is correct because the policy denies the creation of a virtual network if any subnet does not have an NSG associated. The existenceCondition checks that for each subnet, an NSG exists; if false, the deny effect is triggered, and the virtual network creation fails. Option A is wrong because the policy does not audit; it denies. Option B is wrong because the policy denies the entire virtual network deployment. Option D is wrong because the policy does not create an NSG automatically.
What should I do if I get this AZ-500 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-500 subnetting questions on CIDR, address ranges, and subnet selection.
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-500 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-500 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.