NSG rule priority: why Allow 104 beats Deny 105
Short answer
A connection succeeds for HTTPS traffic to Storage in East US 2 (Allow, priority 104 matches first), while traffic to Storage in any other region is denied by the priority 105 rule.
Question
You have a network security group (NSG) bound to an Azure subnet.
You run Get-AzNetworkSecurityRuleConfig and receive the output shown in the following exhibit.

Use the drop-down menus to select the answer choice that completes each statement based on the information presented in the graphic.
NOTE: Each correct selection is worth one point.

Key Takeaways
It tests the lowest-priority-number-wins rule, and the trap is ignoring the region scope attached to each NSG rule.
This SC-500 hotspot tests NSG rule evaluation order: the Allow rule at priority 104 is processed before the Deny rule at priority 105, so HTTPS to East US 2 Storage succeeds and Storage elsewhere is denied.
Common mistake: Choosing that all Storage traffic is denied because a Deny rule exists, or that the later Deny overrides the earlier Allow; NSG evaluation stops at the first match, so priority 104 fires first for East US 2.
Expert Analysis
The governing principle. NSG rule evaluation follows Microsoft's documented priority order: rules are processed from lowest priority number upward, and the first rule whose match criteria fit the traffic is applied — evaluation stops there. Allow and Deny are equal in this hierarchy; only the priority number breaks the tie. The Get-AzNetworkSecurityRuleConfig output shows an Allow rule at priority 104 and a Deny rule at 105, so the Allow wins for any traffic it matches.
Mapping the scenario. The Allow rule is scoped to the Storage service tag in the East US 2 region; the Deny rule at 105 catches Storage traffic in other regions. HTTPS traffic from inside the subnet to a Storage account physically located in East US 2 therefore matches 104 before 105 is ever evaluated, so the connection succeeds. The same HTTPS request aimed at a Storage account in, say, West Europe never matches 104 and is stopped by the Deny at 105.
What the exhibit does not say. Because the rules are evaluated top-down, the source and destination scope, port (443), and protocol (TCP) must all match the Allow entry for the permit to fire. Learners who ignore the region scope or assume Deny always beats Allow reach the wrong verdict. One community note records the identical reading: HTTPS to East US 2 Storage matches 104 ahead of 105, while Storage in other regions is denied.
Official Reference
- https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview
- https://learn.microsoft.com/en-us/azure/virtual-network/service-tags-overview
These links open the official vendor documentation in a new tab.
Exam Strategy
When an NSG hotspot shows two conflicting rules, write the priority numbers in ascending order and cross off each rule as traffic passes it — the first surviving match is the verdict. Then re-check every field of that winning rule (region tag, protocol, port, source/destination) against the question's traffic, because a rule can only win if all criteria align. This ordering technique transfers to any firewall, rule-collection-group, or policy precedence question.
Frequently Asked Questions
Why does the Allow rule at priority 104 win over the Deny rule at 105?
Does a Deny rule always override an Allow rule in an NSG?
What happens to HTTPS traffic to a Storage account outside East US 2?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
azuretrainer1 👍 1Able to connect to East US 2 HTTPS traffic to Storage in East US 2 matches the Allow rule at priority 104 before reaching the Deny rule at 105. Traffic to other Azure Storage regions is denied.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SC-500 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SC-500 Practice Test →