An NSG on a subnet has these inbound rules: Deny-All-Inbound at priority 100 and Allow-RDP-from-AdminSubnet at priority 200. Administrators on AdminSubnet still cannot RDP to a VM in the subnet. What should the network administrator change?
NSG rules are evaluated in ascending priority order, where the lowest numeric value is processed first and the first matching rule determines the outcome. The current deny-all rule at priority 100 will match any inbound traffic, so a lower-priority allow rule (with a higher number, e.g., 200) is never reached. By moving the RDP allow rule to a priority number below 100, it is evaluated before the deny rule and permits the connection, while the deny rule still blocks all other unsolicited inbound traffic.
Why this answer
The NSG rules are evaluated in priority order, with lower numbers having higher precedence. The Deny-All-Inbound rule at priority 100 blocks all traffic, including RDP from AdminSubnet, before the Allow-RDP-from-AdminSubnet rule at priority 200 is evaluated. To allow RDP traffic, the allow rule must have a lower priority number (e.g., 90) than the deny rule (100), ensuring it is evaluated first and permits the traffic before the deny rule blocks it.
Exam trap
The trap here is that candidates assume allow rules override deny rules regardless of priority, but Azure NSGs use priority-based evaluation where the first matching rule (lowest priority number) wins, so a higher-priority deny rule will block traffic even if a lower-priority allow rule exists.
Why the other options are wrong
Deleting the deny rule would remove all inbound traffic restrictions, allowing any source to reach the subnet, which is overly permissive and violates security best practices. The issue is that the allow rule at priority 200 is never evaluated because the deny rule at priority 100 is processed first.
Changing the VM to a different availability zone does not affect NSG rule evaluation; NSG rules are applied at the subnet or NIC level regardless of zone.
When would these options actually be correct?
In a scenario where an NSG has a low-priority deny rule that is too restrictive and the intent is to allow all traffic except specific threats, deleting the deny rule and relying on default allow rules or a more permissive rule set could be correct. For example, if the requirement is to allow all inbound traffic and only block known malicious IPs via a higher-priority deny rule.
In a scenario where a VM in a specific availability zone is experiencing network connectivity issues due to a zonal outage or a zone-specific network virtual appliance failure, moving the VM to a different zone could restore connectivity.
In a scenario where a VM needs to be accessed securely from on-premises without exposing it to the internet, creating a private endpoint for the VM (via Private Link) would be the correct solution.
Why candidates pick the wrong answer
Candidates may think that removing the conflicting deny rule will directly solve the connectivity issue without understanding NSG rule priority evaluation order, assuming that allow rules can override deny rules regardless of priority.
Candidates may mistakenly think that availability zones affect network security or that moving a VM to a different zone could bypass NSG rules.