πŸ”’ Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901
Guided AZ-700 Domain 5
Domain 5 β€” Module 1 of 5 20%
22 of 26 overall

AZ-700 Study Guide

Domain 1: Core Networking Infrastructure

  • Virtual Networks: Your Cloud Foundation Free
  • IP Addressing: Public, Private & Prefixes Free
  • Name Resolution: Azure DNS Free
  • Routing: UDRs, Route Server & NAT Gateway Free
  • VNet Peering and Connectivity
  • Network Monitoring and Diagnostics
  • DDoS Protection and Security Posture

Domain 2: Connectivity Services

  • Site-to-Site VPN: Connecting On-Premises
  • Point-to-Site VPN: Remote Access
  • ExpressRoute Fundamentals
  • ExpressRoute: Advanced Features
  • Azure Virtual WAN
  • Choosing Your Hybrid Connection

Domain 3: Application Delivery Services

  • Azure Load Balancer: Layer 4
  • Traffic Manager: DNS-Based Routing
  • Application Gateway: Layer 7
  • Azure Front Door: Global Delivery
  • Choosing the Right Load Balancer

Domain 4: Private Access to Azure Services

  • Private Link and Private Endpoints
  • Private Endpoint DNS
  • Service Endpoints: When and How

Domain 5: Network Security Services

  • NSGs and Application Security Groups
  • Flow Logs, IP Flow Verify & Network Manager Security
  • Azure Firewall: SKUs and Deployment
  • Azure Firewall Manager and Policies
  • Web Application Firewall (WAF)

AZ-700 Study Guide

Domain 1: Core Networking Infrastructure

  • Virtual Networks: Your Cloud Foundation Free
  • IP Addressing: Public, Private & Prefixes Free
  • Name Resolution: Azure DNS Free
  • Routing: UDRs, Route Server & NAT Gateway Free
  • VNet Peering and Connectivity
  • Network Monitoring and Diagnostics
  • DDoS Protection and Security Posture

Domain 2: Connectivity Services

  • Site-to-Site VPN: Connecting On-Premises
  • Point-to-Site VPN: Remote Access
  • ExpressRoute Fundamentals
  • ExpressRoute: Advanced Features
  • Azure Virtual WAN
  • Choosing Your Hybrid Connection

Domain 3: Application Delivery Services

  • Azure Load Balancer: Layer 4
  • Traffic Manager: DNS-Based Routing
  • Application Gateway: Layer 7
  • Azure Front Door: Global Delivery
  • Choosing the Right Load Balancer

Domain 4: Private Access to Azure Services

  • Private Link and Private Endpoints
  • Private Endpoint DNS
  • Service Endpoints: When and How

Domain 5: Network Security Services

  • NSGs and Application Security Groups
  • Flow Logs, IP Flow Verify & Network Manager Security
  • Azure Firewall: SKUs and Deployment
  • Azure Firewall Manager and Policies
  • Web Application Firewall (WAF)
Domain 5: Network Security Services Premium ⏱ ~13 min read

NSGs and Application Security Groups

Master Network Security Groups β€” rule anatomy, default rules, association levels, Application Security Groups for intent-based rules, and Bastion NSG requirements.

NSGs and Application Security Groups

Network Security Groups (NSGs) are Azure’s built-in, stateful firewall for filtering traffic at the subnet and NIC level. They’re the first line of defence in every Azure network.

🎬 Video coming soon

NSGs and Application Security Groups

NSGs and Application Security Groups

~13:00
β˜• Simple explanation

NSGs are bouncers for your network β€” they check every packet against a list of rules and decide whether to let it in or block it. Each rule says: allow or deny traffic from this source, to this destination, on this port. Rules have priorities β€” lower numbers are checked first.

Network Security Groups contain security rules that filter network traffic. NSGs can be associated with subnets or NICs. Rules are evaluated by priority (100-4096, lower = higher priority). NSGs have default rules allowing VNet-to-VNet traffic, outbound internet, and denying all other inbound.

NSG Rule Anatomy

Every NSG rule has these properties:

PropertyDescriptionValues
PriorityProcessing order β€” lower number = higher priority100 to 4096
SourceWhere traffic originatesIP/CIDR, service tag, ASG, or Any
Source port rangeOriginating port(s)Port number, range, or * (any)
DestinationWhere traffic is goingIP/CIDR, service tag, ASG, or Any
Destination port rangeTarget port(s)Port number, range, or *
ProtocolTransport protocolTCP, UDP, ICMP, ESP, AH, or Any
ActionWhat to do with matching trafficAllow or Deny

Rules are evaluated in priority order (lowest number first). Once a match is found, processing stops. If no rule matches, the default rules apply.

Default Rules

Every NSG comes with three default inbound and three default outbound rules that cannot be deleted (but can be overridden with higher-priority rules):

Default inbound rules:

PriorityNameSourceDestinationPortAction
65000AllowVnetInBoundVirtualNetworkVirtualNetworkAnyAllow
65001AllowAzureLoadBalancerInBoundAzureLoadBalancerAnyAnyAllow
65500DenyAllInBoundAnyAnyAnyDeny

Default outbound rules:

PriorityNameSourceDestinationPortAction
65000AllowVnetOutBoundVirtualNetworkVirtualNetworkAnyAllow
65001AllowInternetOutBoundAnyInternetAnyAllow
65500DenyAllOutBoundAnyAnyAnyDeny

Exam Tip: The VirtualNetwork service tag includes VNet address space, peered VNet space, on-premises ranges connected via VPN/ER, and addresses in service endpoints. It’s broader than just the local VNet.

Association Levels

NSGs can be associated at two levels:

LevelWhat It ProtectsScope
SubnetAll resources in the subnetShared rules for the entire subnet
NICIndividual VM’s network interfacePer-VM rules (more granular)

When both are associated (common pattern):

  • Inbound: Traffic must pass BOTH the subnet NSG AND the NIC NSG. Both must allow the traffic.
  • Outbound: Traffic must pass the NIC NSG first, then the subnet NSG. Both must allow it.
πŸ’‘ NSG Evaluation Order: Subnet + NIC

When NSGs are applied at both subnet and NIC levels, evaluation order depends on traffic direction:

Inbound traffic: Subnet NSG evaluates first, then NIC NSG. Both must allow the traffic for it to reach the VM. If the subnet NSG denies, the NIC NSG never sees it.

Outbound traffic: NIC NSG evaluates first, then subnet NSG. Both must allow the traffic for it to leave. If the NIC NSG denies, the subnet NSG never sees it.

Key exam point: It is not enough for one NSG to allow β€” both must allow. A deny at either level blocks the traffic. This is why best practice is to use subnet-level NSGs for broad rules and only add NIC-level NSGs when specific VMs need different treatment.

Best practice: Associate NSGs at the subnet level for broad rules (allow HTTPS, deny RDP from internet). Use NIC-level NSGs only when specific VMs need different rules from their peers.

NSG vs Azure Firewall
FeatureNetwork Security Group (NSG)Azure Firewall
OSI layerLayer 3/4 (IP, port, protocol)Layer 3/4 plus limited Layer 7 (FQDN filtering)
ScopePer-subnet or per-NICCentralised in hub VNet or VWAN hub
FQDN filteringNo β€” IP addresses and service tags onlyYes β€” filter by domain name in application rules
Threat intelligenceNoYes β€” block known-malicious IPs and domains
Centralised managementPer-VNet β€” each team manages their own NSGsSingle firewall with policies for all spokes
IDPSNoYes (Premium SKU) β€” signature-based intrusion detection
CostFreePer-hour plus per-GB processed
Best forWorkload-level micro-segmentation within a VNetCentralised network-wide traffic control and logging

Application Security Groups (ASGs)

ASGs let you write security rules based on application roles instead of IP addresses.

πŸ”’ Aisha’s scenario: Sentinel Banking has three tiers: web servers, API servers, and database servers. Instead of maintaining rules with individual VM IPs, she creates ASGs:

  1. Create ASGs: WebServers, ApiServers, DbServers
  2. Assign VMs: Each VM’s NIC is associated with its ASG
  3. Write rules using ASG names:
PrioritySourceDestinationPortActionMeaning
100InternetWebServers443AllowHTTPS to web tier
110WebServersApiServers8080AllowWeb calls API
120ApiServersDbServers1433AllowAPI calls database
130AnyDbServersAnyDenyBlock all else to DB

Benefits:

  • Rules are intent-based β€” β€œWebServers can talk to ApiServers” is clearer than IP-based rules
  • When you add a new web server, assign it to the WebServers ASG β€” no rule changes needed
  • Scale without maintaining IP lists

Exam Tip β€” ASG Constraints:

  • All NICs in an ASG must be in the same VNet (not across VNets)
  • A NIC can belong to multiple ASGs
  • Source and destination in the same rule can both be ASGs, but they must be in the same VNet
  • You cannot use ASGs in rules across peered VNets (use IP ranges or service tags instead)

NSG for Azure Bastion

Azure Bastion has specific NSG requirements on the AzureBastionSubnet:

Required inbound rules:

SourcePortProtocolPurpose
Internet443TCPUser sessions to Bastion
GatewayManager443TCPControl plane communication
AzureLoadBalancer443TCPHealth probes
VirtualNetwork8080, 5701AnyData plane (internal)

Required outbound rules:

DestinationPortProtocolPurpose
VirtualNetwork3389, 22TCPRDP/SSH to target VMs
AzureCloud443TCPLogging and diagnostics
VirtualNetwork8080, 5701AnyData plane (internal)
Internet80TCPCertificate revocation checks

Exam Tip: The Bastion NSG requirements are a high-frequency exam topic. Key ports: inbound 443 from Internet (user sessions), outbound 3389/22 to VirtualNetwork (RDP/SSH to VMs), outbound 443 to AzureCloud (logging).

Key Takeaways

  • NSG rules are evaluated by priority (lowest number first); first match wins
  • Default rules allow VNet-to-VNet and outbound internet; deny everything else inbound
  • When NSGs are on both subnet and NIC, traffic must pass both
  • ASGs enable intent-based rules using application role names instead of IPs
  • Bastion has specific NSG requirements β€” memorise the key ports

Test Your Knowledge

Question

In what order are NSG rules evaluated?

Click or press Enter to reveal answer

Answer

By priority number, lowest first (100 before 200). Once a matching rule is found, processing stops. If no custom rule matches, default rules at priority 65000-65500 apply.

Click to flip back

Question

What happens when an NSG is associated with both the subnet and the NIC?

Click or press Enter to reveal answer

Answer

For inbound: traffic must pass both the subnet NSG and the NIC NSG. For outbound: traffic must pass the NIC NSG first, then the subnet NSG. Both must allow the traffic for it to flow.

Click to flip back

Question

What is the key constraint for ASG membership?

Click or press Enter to reveal answer

Answer

All NICs in an ASG must be in the same VNet. ASGs cannot span across VNets. A NIC can belong to multiple ASGs, and rules can use ASGs as both source and destination.

Click to flip back

Question

What inbound traffic must the AzureBastionSubnet NSG allow?

Click or press Enter to reveal answer

Answer

Port 443 from Internet (user sessions), port 443 from GatewayManager (control plane), port 443 from AzureLoadBalancer (health probes), and ports 8080/5701 from VirtualNetwork (data plane).

Click to flip back


Knowledge Check

Aisha creates an NSG rule at priority 100 that denies port 443 inbound, and another at priority 200 that allows port 443 from her ASG. Which applies?

Knowledge Check

Sam adds a new web server VM and assigns its NIC to the WebServers ASG. What else does he need to do for existing NSG rules to apply?


Next up: Flow Logs, IP Flow Verify and Network Manager Security β€” Diagnose NSG issues and enforce security policies with AVNM security admin rules.

← Previous

Service Endpoints: When and How

Next β†’

Flow Logs, IP Flow Verify & Network Manager Security

Guided

I learn, I simplify, I share.

A Guide to Cloud YouTube Feedback

© 2026 Sutheesh. All rights reserved.

Guided is an independent study resource and is not affiliated with, endorsed by, or officially connected to Microsoft. Microsoft, Azure, and related trademarks are property of Microsoft Corporation. Always verify information against Microsoft Learn.