Microsoft Azure Administrator (AZ-104) · Section 4 · 18% of the exam
Create and configure network security groups (NSGs) and application security groups
One of the objectives of the Microsoft Azure Administrator (AZ-104) exam, in the section “Implement and manage virtual networking”. Here is what it covers, the points to remember and a question to try.
What it covers
Azure decides where a packet goes (routes) and whether it may pass (NSG rules). This lesson covers system routes, user-defined routes and next hop types, NSG and application security group design, how subnet and NIC NSGs combine, effective security rules, and the Network Watcher tools that find the cause of a connectivity failure.
Points to remember
- Route choice: longest prefix match first; then user-defined route over BGP over system route.
- UDR next hop types: Virtual network, Internet, Virtual appliance, Virtual network gateway, None. Peering and service endpoint hops are system-only.
- An NVA needs IP forwarding on its NIC (Azure) and in the guest OS, and should sit in its own subnet.
- NSG priority is 100 to 4096; lowest number wins; default rules are 65000, 65001 and 65500.
- NSGs are stateful; deleting an allow rule does not cut existing flows.
Try a question
A subnet NSG contains a rule that allows inbound TCP 443 from the internet. The NIC of a VM in that subnet has its own NSG that contains only default rules. An internet client connects to the VM's public IP on TCP 443. What is the result?
- AThe connection is allowed, because the subnet NSG allows it
- BThe connection is allowed, because NIC NSG rules apply only to outbound traffic and the subnet NSG allows 443
- CThe connection is blocked, because the NIC NSG evaluates it and DenyAllInbound applies
- DThe connection is allowed, because the AllowVNetInBound rule covers the subnet
Show the answer
C. When NSGs are associated with both a subnet and a NIC, inbound traffic is evaluated by the subnet NSG first and the NIC NSG second (outbound is the reverse). Each must permit the flow. Here the NIC NSG's DenyAllInbound blocks the connection, so an allow rule is needed on both.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Routes, network security groups and connectivity troubleshooting teaches this objective (about 50 minutes), and 18 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Create and configure virtual networks and subnets
- Create and configure virtual network peering
- Configure public IP addresses
- Configure user-defined network routes
- Troubleshoot network connectivity
- Evaluate effective security rules in NSGs
- Implement Azure Bastion
- Configure service endpoints for Azure platform as a service (PaaS)
- Configure private endpoints for Azure PaaS
- Configure Azure DNS
- Configure an internal or public load balancer
- Troubleshoot load balancing