vnet-hub, or create new)35 minutes
rg-az104-lab13,region: East US. Review + create > Create.
rg-az104-lab13, Name: vnet-lab13, Address space: 10.60.0.0/16.
Subnets: subnet-web with 10.60.1.0/24. Create.
- Virtual machines > Create > vm-web01, Ubuntu 22.04 LTS,
Standard_B1s, vnet-lab13/subnet-web. Create.
- Repeat for vm-web02.
- Resource group: rg-az104-lab13
- Name: nsg-web
- Region: East US
- Create.
NSG rules are evaluated in priority order (lower number = higher priority). Rules are stateful — if inbound traffic is allowed, response traffic is automatically allowed outbound.
- Source: IP addresses, enter your public IP (e.g., 203.0.113.0/32)
- Source port ranges:
- Destination: Any
- Service: SSH (auto-fills port 22)
- Protocol: TCP
- Action: Allow
- Priority: 100
- Name: Allow-SSH-MyIP
- Add.
- Source: Any
- Service: HTTP (port 80)
- Action: Allow
- Priority: 110
- Name: Allow-HTTP
- Add.
- Source: Any
- Destination: Any
- Action: Deny
- Priority: 4096
- Name: Deny-All-Inbound
- Add
vnet-lab13 / subnet-web > OK.The NSG is now applied at the subnet level, affecting all VMs in that subnet.
- Resource group: rg-az104-lab13
- Name: asg-webservers
- Region: East US
- Create.
- Go to vm-web01 > Networking > select the NIC (e.g.,
vm-web01) > Application security groups > Configure
application security group memberships > add asg-webservers > Save.
- Repeat for vm-web02.
- nsg-web > Inbound security rules > + Add.
- Source: Application security group: asg-webservers
- Destination: Application security group: asg-webservers
- Service: HTTPS (port 443)
- Action: Allow
- Priority: 120
- Name: Allow-HTTPS-To-WebASG
- Add.
This rule allows HTTPS traffic between members of the asg-webservers group
without needing to hardcode IP addresses.
(or search Network Watcher) > Effective security rules to see the
merged subnet + NIC-level rules.
- VM: vm-web01
- Direction: Inbound
- Protocol: TCP
- Local IP/port: 10.60.1.4:80 (or the actual private IP)
- Remote IP/port: 10.60.1.100:12345 (a test IP)
- Check — should show Allow (matching the HTTP rule).
Discuss (no need to execute):
priority); first match wins.
DenyAllInBound (and outbound equivalents) — cannot be deleted, but can be
overridden by lower-numbered custom rules.
if both exist.
nsg-web associated with subnet-webasg-webservers contains both VM NICs and is referenced by an NSG rulerg-az104-lab13 > Delete resource group**.