AZ-104 Implement and Manage Virtual Networking Practice Question
A subnet NSG contains a deny inbound rule for TCP 3389 from Any at priority 100 and an allow inbound rule for TCP 3389 from 10.4.1.0/24 at priority 200. Admin workstations in 10.4.1.0/24 cannot connect by RDP. What change should the administrator make?
⚠ Common exam trap
Test-takers frequently assume allow rules automatically override deny rules, but Azure NSGs use first-match evaluation based on priority numbers, not rule type.
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
✓
Lower the allow rule priority number so it is evaluated before the deny rule.
NSG rules are evaluated in priority order, with lower numbers having higher priority. The deny rule at priority 100 blocks all TCP 3389 traffic from Any, and the allow rule at priority 200 is never reached. Lowering the allow rule's priority number (e.g., to 90) ensures it is evaluated before the deny rule, allowing RDP traffic from 10.4.1.0/24.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Replace the source IP range with an application security group in the allow rule.
Why it's wrong here
Replacing the source IP range with an application security group (ASG) in the allow rule only changes how the source is referenced; it does not alter the evaluation order of the rules. The deny rule still has a higher priority (lower numeric value) and will be evaluated first, blocking TCP 3389 from any source regardless of whether the allow rule uses an IP range or an ASG. ASGs provide logical grouping of resources and simplify rule management, but they have no effect on rule precedence, so this change cannot resolve the conflict.
When this WOULD be correct
If the question described a scenario where the allow rule uses an application security group but the source IPs are not members, or if the deny rule's source is set to 'Any' and the allow rule's source is an ASG that includes the admin workstations, then replacing the source IP range with the ASG in the allow rule would be correct to ensure the allow rule matches the traffic.
- ✗
Change the protocol from TCP to Any in the allow rule.
Why it's wrong here
Changing the protocol from TCP to Any in the allow rule does not affect the priority-based evaluation order. The deny rule still has a lower priority number and will be evaluated first, so it will match and deny the RDP traffic before the allow rule is considered. Additionally, because the deny rule blocks TCP 3389 specifically, widening the allow rule's protocol to Any does not make it match earlier or overcome the deny; the problem is rule precedence, not protocol matching.
When this WOULD be correct
If the allow rule were intended to permit all RDP traffic (including UDP) from 10.4.1.0/24, and the deny rule only blocked TCP 3389, then changing the protocol to Any would allow UDP-based RDP connections.
- ✓
Lower the allow rule priority number so it is evaluated before the deny rule.
Why this is correct
Network Security Group rules are processed in ascending order of their priority value, so the rule with the lowest number (highest priority) is evaluated first. If the deny rule has a lower priority number than the allow rule, it is matched before the allow rule ever runs, and because it denies RDP, the packet is dropped immediately. Lowering the allow rule's priority number — for example from 200 to 100 — places it ahead of the deny rule, so the allow condition is matched first and the deny rule is never reached.
- ✗
Add a user-defined route to the subnet so RDP traffic bypasses the NSG.
Why it's wrong here
A user-defined route (UDR) controls the next hop for traffic leaving a subnet, but it does not bypass Network Security Group filtering. NSGs are stateful packet filters applied at the subnet or network interface level, and they evaluate every packet that attempts to enter or leave, independent of the routing path. Even if you redirect RDP traffic through a virtual appliance or another hop, the subnet's NSG still inspects and applies its rules before the packet leaves; therefore, the deny rule continues to block the connection.
When this WOULD be correct
A UDR would be correct if the question described a scenario where RDP traffic to a VM in a peered VNet is being dropped due to asymmetric routing or a forced-tunneling configuration, requiring a custom route to direct traffic correctly.
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.
✓Lower the allow rule priority number so it is evaluated before the deny rule.Correct answer▾
Why this is correct
Network Security Group rules are processed in ascending order of their priority value, so the rule with the lowest number (highest priority) is evaluated first. If the deny rule has a lower priority number than the allow rule, it is matched before the allow rule ever runs, and because it denies RDP, the packet is dropped immediately. Lowering the allow rule's priority number — for example from 200 to 100 — places it ahead of the deny rule, so the allow condition is matched first and the deny rule is never reached.
✗Replace the source IP range with an application security group in the allow rule.Wrong answer — click to see why▾
Why this is wrong here
The deny rule at priority 100 blocks all inbound RDP traffic, including from 10.4.1.0/24, because NSG rules are evaluated in priority order (lower number = higher priority). Replacing the source IP range with an application security group does not change the evaluation order; the deny rule still applies first.
★ When this WOULD be the correct answer
If the question described a scenario where the allow rule uses an application security group but the source IPs are not members, or if the deny rule's source is set to 'Any' and the allow rule's source is an ASG that includes the admin workstations, then replacing the source IP range with the ASG in the allow rule would be correct to ensure the allow rule matches the traffic.
Why candidates choose this
Candidates may think that using an application security group provides more granular control and might override the deny rule, not realizing that NSG rules are evaluated strictly by priority number regardless of rule type.
✗Change the protocol from TCP to Any in the allow rule.Wrong answer — click to see why▾
Why this is wrong here
The allow rule already permits TCP 3389, so changing the protocol to Any would not fix the issue. The problem is that the deny rule at priority 100 blocks all TCP 3389 traffic before the allow rule at priority 200 is evaluated.
★ When this WOULD be the correct answer
If the allow rule were intended to permit all RDP traffic (including UDP) from 10.4.1.0/24, and the deny rule only blocked TCP 3389, then changing the protocol to Any would allow UDP-based RDP connections.
Why candidates choose this
Candidates may think that the allow rule is too restrictive by only allowing TCP, and that expanding to Any would override the deny rule, not realizing that NSG priority order determines rule evaluation.
✗Add a user-defined route to the subnet so RDP traffic bypasses the NSG.Wrong answer — click to see why▾
Why this is wrong here
NSGs filter traffic within a subnet; they do not route traffic. Adding a UDR would affect routing but cannot bypass NSG rules, as NSGs are evaluated after routing. The issue is rule priority, not routing.
★ When this WOULD be the correct answer
A UDR would be correct if the question described a scenario where RDP traffic to a VM in a peered VNet is being dropped due to asymmetric routing or a forced-tunneling configuration, requiring a custom route to direct traffic correctly.
Why candidates choose this
Candidates may confuse network security groups with routing, thinking that adding a route can override NSG deny rules, or they may misunderstand the role of UDRs in controlling traffic flow versus filtering.
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
Go deeper
Related to this question
Learn chapter
Azure AD Connect and Hybrid Identity
Key term
TCP
TCP (Transmission Control Protocol) is a core internet protocol that ensures data is sent reliably and in order between devices over a network.
Key term
Subnet
A subnet is a logical subdivision of an IP network, created by partitioning a larger network address space using subnet masks.
About these practice questions
Courseiva writes every AZ-104 question from scratch — 1,049 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
5 more ways this is tested on AZ-104
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A subnet has an NSG with an inbound allow rule for TCP 3389 at priority 200 and an inbound deny rule for Internet traffic at priority 100. An administrator still cannot RDP to a virtual machine in the subnet from home. What is the most likely reason?
medium- A.The allow rule is ignored because inbound rules cannot permit RDP.
- ✓ B.The deny rule wins because lower priority numbers are processed first.
- C.NSG rules apply only to outbound traffic, so inbound traffic is unaffected.
- D.The subnet NSG is ignored whenever the VM has a public IP address.
Why B: In Azure Network Security Groups (NSGs), rules are processed in priority order, with lower numbers evaluated first. The deny rule for Internet traffic at priority 100 is processed before the allow rule for TCP 3389 at priority 200, so the deny rule blocks the inbound RDP connection from the internet. This is why the administrator cannot RDP from home.
Variation 2. A subnet has these inbound NSG rules: Rule 100 denies TCP 3389 from Internet, Rule 200 allows TCP 3389 from 10.0.0.0/8, and Rule 300 allows TCP 3389 from AzureLoadBalancer. An administrator in 10.20.5.4 cannot RDP to a VM in the subnet. Why is the connection denied?
medium- ✓ A.The deny rule at priority 100 matches before the allow rule at priority 200.
- B.The AzureLoadBalancer service tag blocks all other inbound traffic on that port.
- C.The VM needs a public IP address for RDP to work from a private source.
- D.NSG rules are processed by longest prefix match, so the /8 source loses to the /32 VM address.
Why A: Network Security Group (NSG) rules are evaluated in priority order, from lowest number to highest. Rule 100 at priority 100 denies TCP port 3389 from the Internet source. The administrator's IP address 10.20.5.4 is not part of the VNet's address space (the VNet does not include 10.20.0.0/16), so it is considered Internet traffic. Therefore, Rule 100 matches and denies the traffic before Rule 200 (which allows from 10.0.0.0/8) can be evaluated.
Variation 3. A VM has an NSG with these inbound rules: Deny-RDP at priority 100 for TCP 3389 from Any, and Allow-RDP-Admins at priority 200 for TCP 3389 from 10.8.1.0/24. Admins from 10.8.1.0/24 still cannot connect by RDP. What change fixes access while keeping all other sources blocked?
medium- A.Change the deny rule to protocol Any so the allow rule will be evaluated first.
- B.Add a UDR that sends TCP 3389 traffic to the VM subnet.
- ✓ C.Move the allow rule to a lower priority number than 100.
- D.Associate an application security group with the VM and keep the existing priorities.
Why C: C is correct because NSG rules are evaluated in priority order, with lower numbers evaluated first. The Deny-RDP rule at priority 100 is evaluated before the Allow-RDP-Admins rule at priority 200, so traffic from 10.8.1.0/24 is denied before the allow rule is reached. Moving the allow rule to a priority lower than 100 (e.g., 90) ensures it is evaluated first, allowing the admin traffic while the deny rule still blocks all other sources.
Variation 4. A backend VM must accept TCP 8443 only from the web tier. The subnet NSG already has a deny-all inbound rule at priority 200. The administrator adds an allow rule for the web tier at priority 300, but the connection still fails. What should be changed?
medium- ✓ A.Change the allow rule to a lower priority number than 200.
- B.Change the allow rule protocol from TCP to Any.
- C.Move the VM to a different subnet so the rule can apply.
- D.Add a route table entry for TCP 8443 to bypass the NSG.
Why A: Azure Network Security Groups (NSGs) process rules in priority order, with lower numbers evaluated first. The existing deny-all inbound rule at priority 200 is evaluated before the new allow rule at priority 300, so the deny rule blocks the traffic before the allow rule can be considered. To permit TCP 8443 from the web tier, the allow rule must have a priority number lower than 200 (e.g., 100) so it is evaluated first and allows the traffic.
Variation 5. A VM in AppSubnet must reach a database VM in DbSubnet on TCP 1433. AppSubnet's NSG has an outbound deny rule for TCP 1433 to Any at priority 200. DbSubnet's NSG has an inbound allow rule for TCP 1433 from ASG-App to ASG-Db at priority 300. Both NICs are in the correct application security groups. Connectivity tests fail. What should the administrator change?
hard- A.Remove the inbound allow rule from DbSubnet so the default rules can take over.
- B.Move the inbound allow rule on DbSubnet to priority 100 so it is evaluated sooner.
- ✓ C.Create an outbound allow rule on AppSubnet with a lower priority number than 200 for TCP 1433 to ASG-Db.
- D.Assign the database VM NIC to ASG-App so the destination rule matches a broader group.
Why C: The AppSubnet's NSG has an outbound deny rule for TCP 1433 to Any at priority 200, which blocks all outbound traffic on that port regardless of destination. To allow the VM in AppSubnet to reach the database VM in DbSubnet, an outbound allow rule must be created with a lower priority number (e.g., 100) so it is evaluated before the deny rule. This rule should specify the destination as ASG-Db (the application security group of the database VM) to precisely permit the required traffic.
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.