Courseiva
Implement and Manage Virtual NetworkinghardMultiple ChoiceObjective-mapped

AZ-104 Implement and Manage Virtual Networking Practice Question

A subnet contains two NSGs: one associated with the subnet and one associated with the NIC of VM-App03. You need to determine whether inbound TCP 3389 from the internet is allowed. What is the correct interpretation?

⚠ Common exam trap

Test-takers frequently assume the NIC NSG overrides the subnet NSG (Option A) or that an allow in one NSG is sufficient (Option B), but Azure requires both NSGs to permit the traffic for it to be allowed.

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

The effective rules are determined by evaluating both NSGs together, and a deny in either applicable path can block access.

When a subnet NSG and a NIC NSG are both applied, Azure evaluates the effective rules by combining both NSGs. Inbound traffic must be allowed by both NSGs along the traffic path; if either NSG has a deny rule that matches the traffic (e.g., a default deny rule for inbound internet traffic), the traffic is blocked. Option C correctly states that a deny in either applicable path can block access, which is the fundamental behavior of NSG evaluation in Azure.

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 NIC NSG always overrides the subnet NSG.

    Why it's wrong here

    No single NSG is granted blanket precedence; instead, Azure defines an evaluation order that applies both rule sets. For inbound traffic, the subnet NSG is processed first, followed by the NIC NSG, but any deny produced by the second NSG still blocks the flow. For outbound traffic, the NIC NSG is checked first and then the subnet NSG. Thus the NIC NSG does not override the subnet NSG; effective security rules are the combined result of both, and the actual allow/deny outcome depends on the specific matching rules, not on a fixed hierarchy of association.

    When this WOULD be correct

    This would be correct if the question stated that the NIC NSG has a higher priority than the subnet NSG and that only the NIC NSG is evaluated for inbound traffic, such as in a scenario where the subnet NSG is not applied to the NIC.

  • Inbound traffic is allowed as long as one NSG has an allow rule.

    Why it's wrong here

    This is incorrect because NSG evaluation is not a simple OR across layers. Each NSG is evaluated independently in priority order, and the first matching rule within that NSG determines that layer's action; a matching deny in any applicable NSG immediately blocks the traffic. An allow rule in the NIC NSG cannot overcome a deny rule in the subnet NSG, nor can a subnet allow overcome a higher-priority NIC deny, so one allow is insufficient to guarantee inbound access.

    When this WOULD be correct

    This option would be correct in a scenario where the question specifies that NSGs are evaluated in a 'union' manner, such as in a hypothetical environment where multiple NSGs are combined and any allow rule permits traffic, or in a context where only one NSG is applied and the other is ignored.

  • The effective rules are determined by evaluating both NSGs together, and a deny in either applicable path can block access.

    Why this is correct

    When both a subnet NSG and a NIC NSG apply to the same virtual machine, Azure aggregates their rules into the effective security rules for the interface. Evaluation does not simply take the least-restrictive rule; instead, a traffic flow must not violate a deny rule at either layer. Therefore, if a deny rule in the subnet NSG matches, the NIC allow rule cannot rescue the flow, and vice versa, so both NSGs must permit the traffic for it to be allowed.

  • Subnet NSGs apply only to outbound traffic.

    Why it's wrong here

    A subnet NSG is a stateful firewall rule set that applies to the subnet interface as a whole, filtering both inbound traffic (from the internet, other subnets, or peered networks) and outbound traffic (to any destination). The same NSG can have inbound and outbound security rules with separate priorities and actions. Therefore, limiting subnet NSGs to outbound traffic ignores their primary role in controlling inbound access to all resources placed in that subnet.

    When this WOULD be correct

    If the question asked about the default behavior of a subnet NSG when no explicit inbound rules are defined, but outbound rules are configured, then a candidate might incorrectly think subnet NSGs only apply to outbound traffic. However, this is never correct; subnet NSGs always apply to both directions.

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.

The effective rules are determined by evaluating both NSGs together, and a deny in either applicable path can block access.Correct answer

Why this is correct

When both a subnet NSG and a NIC NSG apply to the same virtual machine, Azure aggregates their rules into the effective security rules for the interface. Evaluation does not simply take the least-restrictive rule; instead, a traffic flow must not violate a deny rule at either layer. Therefore, if a deny rule in the subnet NSG matches, the NIC allow rule cannot rescue the flow, and vice versa, so both NSGs must permit the traffic for it to be allowed.

The NIC NSG always overrides the subnet NSG.Wrong answer — click to see why

Why this is wrong here

In Azure, NSGs are evaluated in order: subnet NSG first, then NIC NSG. A deny rule in either NSG can block traffic, so the NIC NSG does not always override the subnet NSG.

★ When this WOULD be the correct answer

This would be correct if the question stated that the NIC NSG has a higher priority than the subnet NSG and that only the NIC NSG is evaluated for inbound traffic, such as in a scenario where the subnet NSG is not applied to the NIC.

Why candidates choose this

Candidates may think that the more specific NSG (NIC) always takes precedence over the broader one (subnet), similar to how firewall rules work in some other systems.

Inbound traffic is allowed as long as one NSG has an allow rule.Wrong answer — click to see why

Why this is wrong here

In Azure, when both a subnet NSG and a NIC NSG exist, traffic is evaluated by both NSGs in sequence. A deny rule in either NSG will block traffic, so an allow rule in one NSG does not guarantee traffic is allowed if the other NSG denies it.

★ When this WOULD be the correct answer

This option would be correct in a scenario where the question specifies that NSGs are evaluated in a 'union' manner, such as in a hypothetical environment where multiple NSGs are combined and any allow rule permits traffic, or in a context where only one NSG is applied and the other is ignored.

Why candidates choose this

Candidates may mistakenly think that NSGs work like firewall rules where an allow rule in any applicable NSG overrides denies, or they may confuse Azure NSG behavior with other cloud providers' security group rules that are additive.

Subnet NSGs apply only to outbound traffic.Wrong answer — click to see why

Why this is wrong here

Subnet NSGs apply to both inbound and outbound traffic, not just outbound. In this question, the subnet NSG can deny inbound TCP 3389 from the internet, affecting the effective rule.

★ When this WOULD be the correct answer

If the question asked about the default behavior of a subnet NSG when no explicit inbound rules are defined, but outbound rules are configured, then a candidate might incorrectly think subnet NSGs only apply to outbound traffic. However, this is never correct; subnet NSGs always apply to both directions.

Why candidates choose this

Candidates may confuse subnet NSGs with route tables or think that NSGs are unidirectional, leading them to believe subnet NSGs only handle outbound traffic.

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?”

Visual reference

192.168.1.0 /24 256 addresses (254 usable) 192.168.1.0 /25 Subnet A 128 addr (126 usable) 192.168.1.128 /25 Subnet B 128 addr (126 usable) Borrowing 1 bit from host portion creates 2 subnets (/25)

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 →

How Courseiva writes practice questions · Editorial policy

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.