If an NSG is on both the subnet and the NIC, how is traffic evaluated?
AdvancedConceptNetworking
Answer
Inbound: subnet NSG first, then NIC NSG. Outbound: NIC NSG first, then subnet NSG. Traffic must be allowed by both. A deny at either layer drops it.
That is why "I opened port 443 on the NSG and it still times out" usually means there is a second NSG. Check the effective rules:
az network nic list-effective-nsg -g rg -n vm-web-nic -o table
We prefer subnet-level NSGs only, to keep a single place to look.
More on Networking
What is a VNet and how does it compare to an AWS VPC?BeginnerHow many IP addresses does Azure reserve in each subnet?BeginnerWhat is a Network Security Group and how are its rules evaluated?BeginnerWhat are service tags and why use them in NSG rules?BeginnerWhat is an Application Security Group (ASG)?IntermediateWhat are system routes and user-defined routes (UDRs)?Intermediate