Domain 2 β€” Module 3 of 8 38%
9 of 28 overall
Domain 2: Secure storage, databases, and networking Free ⏱ ~11 min read

Network Security: NSGs, ASGs, Azure Virtual Network Manager

L3/L4 segmentation on Azure β€” Network Security Groups, Application Security Groups for label-based rules, and Azure Virtual Network Manager (AVNM) for centralised network access policies across many VNets.

The L3/L4 layer of Azure networking security

Simple explanation

Network Security Groups (NSGs) are Azure’s stateful firewall at the subnet or NIC level β€” allow/deny rules based on source/destination IP, port, and protocol. They are simple, free, and applied close to the workload. They’re the bread-and-butter L3/L4 control.

Application Security Groups (ASGs) let you reference groups of NICs by name in NSG rules instead of CIDR ranges. β€œAllow web-tier ASG to talk to db-tier ASG on 3306” is much more maintainable than β€œallow 10.5.6.0/26 to 10.5.7.0/26 on 3306”.

Azure Virtual Network Manager (AVNM) is the newer centralised network manager β€” define hub-and-spoke connectivity, mesh connectivity, and security admin rules at scale across many VNets in one place. AVNM security admin rules even take priority over NSG rules β€” Azure-side enforcement.

Network Security Groups (NSGs)

Scope and rule structure

NSGs apply at subnet (recommended for fleet management) or NIC (fine-grained, used for exceptions). Each NSG has up to 1000 rules across inbound and outbound. Each rule has:

  • Priority (100–4096, lower wins)
  • Source β€” IP/CIDR, service tag, ASG, or *
  • Destination β€” same options
  • Protocol β€” TCP/UDP/ICMP/ESP/AH/Any
  • Source port range + Destination port range
  • Action β€” Allow or Deny

Default rules (priorities 65000+) sit at the end:

  • AllowVNetInBound / AllowVNetOutBound β€” VNet-internal traffic
  • AllowAzureLoadBalancerInBound β€” health probes
  • AllowInternetOutBound β€” outbound to internet by default
  • DenyAllInBound / DenyAllOutBound β€” final catch-all

Service tags β€” the maintainable way

Service tags represent groups of Microsoft-maintained IP prefixes. Common SC-500-relevant ones:

  • Internet, VirtualNetwork, AzureLoadBalancer
  • AzureCloud / AzureCloud.<region> β€” all Azure datacentre IPs (in region)
  • Storage / Storage.<region> β€” Azure Storage public endpoints (in region)
  • Sql / Sql.<region> β€” Azure SQL endpoints
  • AzureKeyVault.<region>
  • AzureMonitor, AzureActiveDirectory, AzureFrontDoor.Backend

Using service tags means Microsoft maintains the underlying IP ranges; rules stay current automatically.

Application Security Groups (ASGs)

ASGs let NSG rules reference groups of NICs by name. Pattern:

  1. Create ASGs web-tier, app-tier, db-tier.
  2. Attach NICs to the right ASG (a NIC can belong to multiple ASGs).
  3. NSG rule: source = web-tier, destination = app-tier, port = 443, action = Allow.

Two key constraints:

  • All NICs referenced by an NSG rule via ASG must be in the same VNet as the NSG.
  • ASGs do NOT span VNets (use AVNM security admin rules or hub-and-spoke + NSGs for cross-VNet rules).

Azure Virtual Network Manager (AVNM)

AVNM scales network governance across many VNets via three configuration types:

AVNM configurations β€” connectivity, security admin rules, routing
ConfigurationWhat it does
ConnectivityHub-and-spoke topology (auto-creates hub VNet + spoke peerings) or mesh (any-to-any peering across the scope). Replaces manual peering at scale.
Security admin rulesPriority-enforced NSG-like rules applied to all VNets in scope. Intents: AlwaysAllow / Allow / Deny. AlwaysAllow + Deny intents take priority OVER NSG rules β€” central enforcement that NSGs cannot override.
Routing (preview/GA depending on region)Centralised user-defined route management across many VNets.

Security admin rules vs NSGs

This is the most-tested AVNM distinction on SC-500:

NSG rules vs AVNM security admin rules β€” local vs central
FeatureNSG ruleAVNM Security Admin rule
ScopeSubnet or NIC, within one VNetMultiple VNets defined by AVNM network groups
Priority over NSGLower-priority NSGs in chain compose normallyAlwaysAllow and Deny intents OVERRIDE NSG rules β€” central enforcement
Created bySubnet/VNet owner β€” local controlTenant network admin β€” central control
Use caseLocal subnet hardeningTenant-wide invariants ('always deny inbound 22 from Internet', 'always allow Azure Bastion to all RDP/SSH')

The exam pattern: when the scenario describes tenant-wide invariants (block SSH from internet across ALL VNets, regardless of subnet-team-set NSGs), the answer is AVNM security admin rules with Deny intent. When the scenario describes subnet-specific allow lists, the answer is NSGs (optionally with ASGs).

Priority interaction: how AVNM and NSGs compose

When a packet hits a VNet’s subnet:

  1. AVNM Security Admin rules apply first. AlwaysAllow β†’ pass through (no NSG evaluation). Deny β†’ drop (NSG cannot override). Allow β†’ fall through to NSG evaluation.
  2. NSG rules then evaluate normally β€” subnet NSG first, then NIC NSG.

This is the central-control mechanism: a Deny security admin rule cannot be bypassed by an NSG owner adding a permissive Allow rule. Conversely, an AlwaysAllow ensures a specific path (e.g. Azure Bastion subnets reaching RDP) can never be blocked by an over-zealous NSG configured by a junior admin.

Scenario: Asha builds tenant-wide segmentation at Aurora Health Service

Across 47 subscriptions and ~120 VNets, Asha needs:

  1. AVNM security admin rules at the tenant scope:
    • Deny inbound from Internet on TCP/22 and 3389 (SSH/RDP) β€” enforced across all VNets, no local-team override possible.
    • AlwaysAllow inbound from AzureBastion subnets β€” Bastion is the only sanctioned RDP/SSH path.
    • Deny inbound from Internet to AzureKeyVault service tag destinations on VNet peripheries.
  2. Hub-and-spoke connectivity via AVNM connectivity configuration β€” auto-creates and maintains peerings for new spokes added to the network group.
  3. Per-VNet NSGs with ASGs for application tier segmentation β€” web-tier β†’ app-tier on 443; app-tier β†’ db-tier on 1433; everything else default-deny.
  4. Service tag-based outbound rules β€” application subnets allowed outbound only to specific service tags (AzureCloud.AustraliaEast, AzureKeyVault.AustraliaEast, Sql.AustraliaEast, Storage.AustraliaEast) β€” internet outbound denied by default.

Result: tenant-wide invariants enforced centrally; per-VNet teams retain local control; application traffic flows on labelled paths; outbound restricted to known Microsoft service ranges.

Key terms

Question

What is the difference between NSG scope at subnet vs NIC level?

Click or press Enter to reveal answer

Answer

Subnet-level NSGs apply to all NICs in the subnet β€” recommended for fleet management. NIC-level NSGs apply only to that NIC β€” used for exceptions or fine-grained control. If both are present, both are evaluated and the most restrictive wins (a Deny at either level blocks the traffic).

Click to flip back

Question

What is an Application Security Group (ASG)?

Click or press Enter to reveal answer

Answer

A label-based grouping of NICs that NSG rules can reference as source or destination. Lets you write rules in business terms ('web β†’ app β†’ db') instead of CIDR ranges. NICs can belong to multiple ASGs. ASGs do NOT span VNets β€” use AVNM security admin rules or hub-and-spoke for cross-VNet rules.

Click to flip back

Question

What is Azure Virtual Network Manager (AVNM)?

Click or press Enter to reveal answer

Answer

Centralised network governance for many VNets β€” three configuration types: connectivity (hub-and-spoke or mesh), security admin rules (priority-enforced NSG-like rules applied centrally), and routing. Security admin rules with AlwaysAllow or Deny intent take priority OVER NSGs β€” central enforcement that subnet teams cannot override.

Click to flip back

Question

When does an AVNM security admin rule take priority over an NSG rule?

Click or press Enter to reveal answer

Answer

Always β€” AVNM Security Admin rules evaluate before NSGs. A Deny intent rule overrides any NSG Allow rule on the path; an AlwaysAllow intent passes through without NSG evaluation. Used to enforce tenant-wide invariants that local subnet teams cannot override.

Click to flip back

Question

What are service tags in NSG rules?

Click or press Enter to reveal answer

Answer

Microsoft-maintained labels representing groups of IP prefixes (e.g. `Internet`, `VirtualNetwork`, `AzureCloud`, `Storage.WestEurope`, `Sql`, `AzureKeyVault.<region>`). Using service tags in NSG rules means Microsoft updates the underlying IP ranges as their services evolve β€” your rules stay current without manual maintenance.

Click to flip back

Knowledge check

Knowledge Check

Asha at Aurora Health Service wants to ensure that inbound TCP/22 from the public internet is blocked across ALL 120 VNets in the tenant, regardless of any NSG rules that local subnet teams configure. Which capability fits?

Knowledge Check

Ravi at Maple Genomics has a 3-tier app β€” web NICs, app NICs, db NICs β€” within one VNet. He wants NSG rules that say 'web tier can talk to app tier on 443' without listing IP ranges that change with scale-out. Which feature fits?

Knowledge Check

Esme at Northwind Bank's network team wants to allow Azure VMs in a banking subnet to reach Azure Key Vault in the same Azure region β€” but only Azure Key Vault, not arbitrary internet destinations. Which NSG rule construction is cleanest?

What’s next

Next: Azure Virtual WAN security β€” secured virtual hubs, branch connectivity, and the security posture of a hub-and-spoke deployment at large scale.