Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

6.1.1. NSG Rules and Processing

Default Rules (cannot be deleted):
DirectionPriorityNameAction
Inbound65000AllowVnetInBoundAllow traffic from VNet
Inbound65001AllowAzureLoadBalancerInBoundAllow LB probes
Inbound65500DenyAllInBoundDeny all other
Outbound65000AllowVnetOutBoundAllow traffic to VNet
Outbound65001AllowInternetOutBoundAllow internet
Outbound65500DenyAllOutBoundDeny all other
Rule Processing:
  1. Rules evaluated by priority (lower number = higher priority)
  2. First matching rule wins
  3. If no rule matches, default deny
Rule Components:
PropertyPurpose
Priority100-4096 (lower = higher priority)
Source/DestinationIP, CIDR, service tag, ASG
ProtocolTCP, UDP, ICMP, Any
PortSingle, range, or Any
ActionAllow or Deny
Service Tags:

Service tags represent groups of IP prefixes managed by Microsoft:

TagRepresents
VirtualNetworkVNet space + peered VNets + on-premises
InternetAll public IPs
AzureLoadBalancerAzure LB health probes
StorageAzure Storage (region-specific available)
SqlAzure SQL Database
NSG Association:
LevelScopeBest Practice
SubnetAll NICs in subnetBroad rules, standard policies
NICSingle VMSpecific rules, sensitive workloads

⚠️ Exam Trap: Both subnet and NIC NSGs are evaluated. Traffic must be allowed by BOTH (most restrictive wins).

Alvin Varughese
Written byAlvin Varughese
Founder15 professional certifications