Skip to main content
Network Security Groups (NSGs) control traffic to and from Azure resources. When an NSG is attached at both the subnet and network interface (NIC) scopes, Azure evaluates both sets of rules together. The merged outcome for a specific NIC is called the effective rules for that network interface. In the diagram below you can see the traffic flow. A NIC sits inside a subnet. Traffic is evaluated against the NSG attached to the NIC and the NSG attached to the subnet. Both NSG1 and NSG2 must allow the traffic for it to be permitted; if either NSG denies the traffic, the traffic is dropped.
The image is a slide titled "NSG Effective Rules" showing a diagram of a subnet with a NIC and arrows linking it to two network security groups (NSG1 and NSG2). On the left are three turquoise callouts labeled "Independent Evaluation," "Allow Rule Requirement," and "Effective Rules Link."
Effective rules are the authoritative view for what security rules are applied to a particular network interface — use them first when troubleshooting connectivity issues involving NSGs.

How Azure evaluates NSG rules

  • NSGs are evaluated independently at each scope (subnet and NIC).
  • For a packet to be admitted, an allow rule must exist at both scopes. If either scope denies the packet, the packet is blocked.
  • Rules are matched by priority (lowest priority number is evaluated first) and stop on the first match per NSG scope. The effective result is the combination of the NIC and subnet evaluations.
Use-case keywords: Azure NSG effective rules, NSG evaluation, subnet vs NIC NSG, troubleshooting NSG.

Rule evaluation summary (quick reference)

ScopeWhat is evaluatedNotes
Subnet NSGRules applied to the entire subnetControls traffic for all NICs in that subnet unless overridden/restricted by NIC NSG
NIC NSGRules applied to the individual network interfaceCan further restrict or allow traffic; both NIC and subnet must allow a flow for it to succeed
Effective rulesCombined, authoritative view for a NICShows which allow/deny decisions are applied after merging the two scopes

Viewing effective rules in the Azure portal

To quickly determine why traffic is permitted or blocked for a VM, inspect the effective security rules for the VM’s NIC:
  1. Open the Azure portal.
  2. Navigate to the Virtual machine and select the VM.
  3. In the VM blade, select Networking and click the NIC name, or directly open the Network interfaces resource for the target NIC.
  4. On the NIC resource page, open “Effective security rules” (often under Support + troubleshooting). Azure displays the merged rules that apply to that NIC (including both subnet and NIC NSG rules).
Note: The portal’s Effective security rules view is the definitive, consolidated list to use when troubleshooting connectivity issues.
If a deny rule exists at either the subnet or NIC scope, the traffic is blocked even if the other scope contains an allow rule. Always check both the NIC and subnet NSGs (or use the Effective security rules view) before changing rules.

Troubleshooting checklist

  • Confirm the VM’s NIC is attached to the expected subnet and that the correct NSGs are associated at both NIC and subnet scopes.
  • Open Effective security rules for the NIC to see exactly which rules are in effect (including source/destination, protocol, ports, action, and priority).
  • Verify there are no higher-priority deny rules that match the traffic.
  • Remember default/system rules exist and may affect flows (the Effective security rules view includes system rules).
  • If expected rules aren’t shown, ensure you’re viewing the correct NIC and that any recent NSG changes have propagated.

Best practices

  • Prefer simpler rule sets and group related VMs into subnets with shared NSGs to reduce per-NIC complexity.
  • Use application security groups (ASGs) to avoid many IP-based rules and keep rules human-readable.
  • Audit and document NSG rules and priorities to simplify troubleshooting.
  • Use the Effective security rules view as your first step in diagnostics — it reveals the final, evaluated set of rules.

References and further reading