Question 984 of 1,170
Implement and Manage Virtual NetworkingmediumMultiple ChoiceObjective-mapped

Why Lower Priority Numbers in Azure NSG Rules Are Processed First

This AZ-104 practice question tests your understanding of implement and manage virtual 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.

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?

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.

The correct answer is C because 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.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

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

    Source grouping helps manageability, but it does not fix a higher-priority deny rule.

    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

    The rule already matches RDP traffic; protocol broadening does not change priority order.

    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

    NSG rules are evaluated from lowest number to highest, so the allow must come first.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Add a user-defined route to the subnet so RDP traffic bypasses the NSG.

    Why it's wrong here

    Routing changes do not bypass NSG filtering, because NSGs still evaluate the packet.

    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

NSG rules are evaluated from lowest number to highest, so the allow must come first.

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

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume allow rules automatically override deny rules, but Azure NSGs use first-match evaluation based on priority numbers, not rule type.

Detailed technical explanation

How to think about this question

Azure NSGs process rules in ascending priority order (lowest number first) and stop at the first match; a deny rule at priority 100 for TCP 3389 from Any will block all RDP traffic, including from 10.4.1.0/24, before the allow rule at priority 200 is evaluated. This is a common misconfiguration where administrators assume allow rules override deny rules, but in Azure, the first matching rule applies, and deny rules take precedence if they appear earlier. In real-world scenarios, always plan priority numbering with gaps (e.g., 100, 200, 300) to allow insertion of new rules without renumbering.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A healthcare organisation deploys an application with a public-facing web tier and a private database tier. The database subnet has no public IP and only accepts connections from the web tier's security group. Questions like this test whether you can design cloud network isolation using VNets/VPCs, subnets, and security group rules.

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)

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

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.

Practice this exam

Start a free AZ-104 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this AZ-104 question test?

Implement and Manage Virtual Networking — This question tests Implement and Manage Virtual Networking — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Lower the allow rule priority number so it is evaluated before the deny rule. — The correct answer is C because 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.

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

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

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 →

How Courseiva writes practice questions · Editorial policy

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: Option A is correct. 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: Option C is correct because 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.

Keep practising

More AZ-104 practice questions

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

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.