Why a Deny Rule at Lower Priority Number Blocks RDP Despite an Allow Rule
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?
Quick Answer
The answer is that the deny rule at priority 100 blocks RDP because lower priority numbers are processed first in Azure NSGs. This happens because Network Security Group rules are evaluated in ascending priority order, meaning a rule with priority 100 is checked and applied before a rule at priority 200. Since the deny rule for all Internet traffic is evaluated first, it matches and blocks the inbound RDP connection from your home IP before the allow rule for TCP 3389 ever gets a chance to be considered. On the AZ-104 exam, this concept frequently appears as a trick question where candidates assume a higher-numbered allow rule will override a lower-numbered deny rule, but the opposite is true—the lowest number always wins. A common memory tip is to think of priority numbers like a bouncer’s list: the smaller number gets let in first, and if that bouncer says “deny,” no later bouncer can overrule it.
⚠ Common exam trap
It's easy for candidates to assume a higher-priority allow rule can override a lower-priority deny rule, but in Azure NSGs, lower priority numbers are processed first, so a deny at priority 100 blocks traffic before an allow at priority 200 is even considered.
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 deny rule wins because lower priority numbers are processed first.
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.
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 allow rule is ignored because inbound rules cannot permit RDP.
Why it's wrong here
NSGs can allow or deny RDP traffic. The issue is not the protocol itself, but how the rules are prioritized and matched.
When this WOULD be correct
This option would be correct if the question stated that Azure NSGs do not support inbound rules for RDP, or if the exam asked about a different platform (e.g., AWS security groups) where RDP inbound rules are not allowed by default.
- ✓
The deny rule wins because lower priority numbers are processed first.
Why this is correct
Azure NSG rules are evaluated in priority order, and the lowest number is processed first. Because the deny rule has priority 100, it is evaluated before the allow rule at 200 and blocks the traffic.
- ✗
NSG rules apply only to outbound traffic, so inbound traffic is unaffected.
Why it's wrong here
NSGs filter both inbound and outbound traffic. Inbound traffic can absolutely be blocked by an NSG rule on the subnet or NIC.
When this WOULD be correct
If the question asked about a default NSG rule or a scenario where only outbound rules were configured, and the VM had no inbound NSG rules, then outbound-only rules would not affect inbound RDP traffic.
- ✗
The subnet NSG is ignored whenever the VM has a public IP address.
Why it's wrong here
A public IP does not bypass NSG evaluation. Traffic still must satisfy the applicable inbound and outbound security rules.
When this WOULD be correct
If the question stated that the VM has a public IP and the subnet NSG is configured to deny all inbound traffic, but the VM's NIC NSG has an allow rule for RDP, then the subnet NSG would still block traffic because subnet NSGs are evaluated before NIC NSGs. However, the statement 'ignored whenever the VM has a public IP address' is never correct; NSGs are always applied.
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 deny rule wins because lower priority numbers are processed first.Correct answer▾
Why this is correct
Azure NSG rules are evaluated in priority order, and the lowest number is processed first. Because the deny rule has priority 100, it is evaluated before the allow rule at 200 and blocks the traffic.
✗The allow rule is ignored because inbound rules cannot permit RDP.Wrong answer — click to see why▾
Why this is wrong here
In Azure, NSG inbound rules can permit RDP (TCP 3389) traffic, so the allow rule is valid. The issue is not that the rule type is invalid, but that the deny rule at a lower priority number (100) overrides the allow rule at priority 200.
★ When this WOULD be the correct answer
This option would be correct if the question stated that Azure NSGs do not support inbound rules for RDP, or if the exam asked about a different platform (e.g., AWS security groups) where RDP inbound rules are not allowed by default.
Why candidates choose this
Candidates may mistakenly think that RDP is inherently blocked or that NSGs have restrictions on certain protocols, leading them to believe the allow rule is ignored rather than understanding priority-based rule evaluation.
✗NSG rules apply only to outbound traffic, so inbound traffic is unaffected.Wrong answer — click to see why▾
Why this is wrong here
NSG rules apply to both inbound and outbound traffic; inbound rules can control RDP access. The issue here is priority order, not direction.
★ When this WOULD be the correct answer
If the question asked about a default NSG rule or a scenario where only outbound rules were configured, and the VM had no inbound NSG rules, then outbound-only rules would not affect inbound RDP traffic.
Why candidates choose this
Candidates may confuse NSG rules with route tables or think NSGs are unidirectional, overlooking that NSGs have separate inbound and outbound rule sets.
✗The subnet NSG is ignored whenever the VM has a public IP address.Wrong answer — click to see why▾
Why this is wrong here
NSGs apply to subnets and network interfaces regardless of public IP assignment; a VM with a public IP still has its inbound traffic filtered by the subnet NSG.
★ When this WOULD be the correct answer
If the question stated that the VM has a public IP and the subnet NSG is configured to deny all inbound traffic, but the VM's NIC NSG has an allow rule for RDP, then the subnet NSG would still block traffic because subnet NSGs are evaluated before NIC NSGs. However, the statement 'ignored whenever the VM has a public IP address' is never correct; NSGs are always applied.
Why candidates choose this
Candidates may mistakenly think that a public IP bypasses NSG rules, confusing public IP assignment with direct internet access without network security 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
Dynamic Membership Groups
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
Security
Security in IT is the practice of protecting systems, networks, and data from unauthorized access, damage, or theft.
About these practice questions
This AZ-104 question is part of Courseiva's 1,049-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
4 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 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?
medium- A.Replace the source IP range with an application security group in the allow rule.
- B.Change the protocol from TCP to Any in the allow rule.
- ✓ C.Lower the allow rule priority number so it is evaluated before the deny rule.
- D.Add a user-defined route to the subnet so RDP traffic bypasses the NSG.
Why C: 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.
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.
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.