mediummultiple choiceObjective-mapped

A VM in a subnet has both a subnet-level NSG and a NIC-level NSG. The subnet NSG allows inbound TCP 22 from the VirtualNetwork service tag, but the NIC NSG denies inbound TCP 22 from the same source. An administrator says the subnet rule should be enough because it allows the traffic. What is the actual behavior?

Question 1mediummultiple choice
Full question →

A VM in a subnet has both a subnet-level NSG and a NIC-level NSG. The subnet NSG allows inbound TCP 22 from the VirtualNetwork service tag, but the NIC NSG denies inbound TCP 22 from the same source. An administrator says the subnet rule should be enough because it allows the traffic. What is the actual behavior?

Answer choices

Why each option matters

Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.

A

Distractor review

The allow rule wins because subnet NSGs always override NIC NSGs.

Subnet NSGs do not automatically override NIC NSGs. Both scopes are evaluated, and a deny at either scope blocks the traffic.

B

Best answer

The traffic is blocked because a deny in either NSG is effective.

Azure evaluates both NIC and subnet NSGs. If either one denies the packet, the connection is blocked even if the other NSG has an allow rule.

C

Distractor review

The traffic is allowed because service tags bypass NIC-level rules.

Service tags simplify rule targeting, but they do not bypass evaluation or ignore a deny rule at another NSG scope.

D

Distractor review

The connection succeeds unless a route table sends the traffic elsewhere.

Routing affects the path, not the security decision. NSG denies are enforced independently of route table configuration.

Common exam trap

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.

Technical deep dive

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.

Related practice questions

Related AZ-104 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

More questions from this exam

Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.

FAQ

Questions learners often ask

What does this AZ-104 question test?

CIDR notation defines the prefix length.

What is the correct answer to this question?

The correct answer is: The traffic is blocked because a deny in either NSG is effective. — In Azure, packet filtering is effectively the result of both NSG scopes. A packet must be allowed by the relevant rules at the subnet and NIC levels. If either NSG has a matching deny rule, the traffic is blocked. In this scenario, the NIC-level deny on TCP 22 prevents access even though the subnet-level NSG allows it. Why others are wrong: Subnet NSGs do not override NIC NSGs. Service tags help define the source or destination, but they do not exempt traffic from another deny rule. Route tables determine where packets go, not whether the security rules permit them.

What should I do if I get this AZ-104 question wrong?

Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.

Discussion

Loading comments…

Sign in to join the discussion.