NSGs, ASGs & Service Tags: AZ-500 Networking Fundamentals
Network Security Groups are the exam's most common networking topic. Learn rule priority, the difference between NSGs and ASGs, and how Service Tags simplify rules for Azure platform services.
Network Security Groups (NSGs)
An NSG is a stateful firewall applied to a subnet or a NIC. Rules are evaluated in priority order (lowest number wins with highest priority). Rules 65000 to 65500 are default rules you cannot delete:
| Priority | Rule | Action |
|---|---|---|
| 65000 | AllowVnetInBound | Allow |
| 65001 | AllowAzureLoadBalancerInBound | Allow |
| 65500 | DenyAllInBound | Deny |
Application Security Groups (ASGs)
ASGs let you group VMs by role (for example, "WebServers" or "DatabaseServers") and reference that group in NSG rules instead of individual IPs. As VMs are added to or removed from an ASG, NSG rules update automatically.
Use case: allow WebServers ASG to reach DatabaseServers ASG on port 1433: no IP management required.
Service Tags
Service Tags represent Microsoft-managed IP ranges for Azure services. Instead of maintaining a list of Azure SQL IPs, you write a rule allowing the Sql service tag on port 1433.
Key service tags for the exam: AzureCloud, Storage, Sql, AzureLoadBalancer, VirtualNetwork, Internet, AzureMonitor. Exam trap: Service Tags are read-only. You cannot create custom service tags. For custom grouping use ASGs.
NSG Association Priority
An NSG on a subnet and an NSG on a NIC both apply. Traffic must be allowed by both. For inbound: subnet NSG evaluates first, then NIC NSG. For outbound: NIC NSG evaluates first, then subnet NSG.
Get weekly security insights
Cloud security, zero trust, and identity guides — straight to your inbox.
Microsoft Cloud Solution Architect
Cloud Solution Architect with deep expertise in Microsoft Azure and a strong background in systems and IT infrastructure. Passionate about cloud technologies, security best practices, and helping organizations modernize their infrastructure.
Questions & Answers
Related Articles
Need Help with Your Security?
Our team of security experts can help you implement the strategies discussed in this article.
Contact Us