Allow HTTPS with a service tag
Your tasks
- Let vm-client reach vm-web on 443
- Let vm-partner reach vm-web on 443
nsg-web on subnet-web blocks everything inbound to vm-web (10.1.1.4). HTTPS (443) on vm-web should be open to vm-client in vnet-app and to vm-partner in vnet-partner, with one rule. vnet-partner is already peered to vnet-app, which means the two VNets are joined so their VMs can talk. You'll build a peering yourself later. SSH (22) stays closed.
You'll learn
Service tags
See the rule that blocks everything.
az network nsg rule list -g rg-lab --nsg-name nsg-web -o tableWhat's this?
Lists the rules in a network security group, so you can read them in priority order.
-gthe resource group the resources live in--nsg-namethe network security group the rule is in
Allow HTTPS from the VirtualNetwork tag, at a priority that runs before the deny.
az network nsg rule create -g rg-lab --nsg-name nsg-web --name Allow-HTTPS-VNet --priority 300 --direction Inbound --access Allow --protocol Tcp --source-address-prefixes VirtualNetwork --destination-port-ranges 443What's this?
Adds or changes one rule in a network security group (NSG). Rules are checked from the lowest priority number up, and the first match decides.
-gthe resource group the resources live in--nsg-namethe network security group the rule is in--namethe name of the thing to look at or change--prioritywhere the rule sits in the order. Lower numbers are checked first--directionInbound for traffic coming in to the VM, Outbound for traffic leaving it--accessAllow or Deny--protocolTCP or UDP--source-address-prefixeswhich source addresses the rule matches--destination-port-rangeswhich ports the rule matches
--source-address-prefixes VirtualNetworkthe service tag, instead of a list of ranges--priority 300lower than the deny's 4000, so it's processed first
Answer the question below.
Sources on Microsoft Learn (2)
0/1 changes
Network map
?
- Resource group, the outer dashed frame
- Virtual network, with its address space top right
- Subnet, with range and usable IPs (5 reserved)
- Network security group. A small shield on a VM's NIC means the NIC has one too
- Route table on the subnet
- VM Appliance Private endpoint
- Peering Connected Initiated or access off
- Goal working Goal broken, X marks where it stops
- Private DNS zone, dotted lines go to linked VNets
- Orange pulse: what your last command changed. Drag to pan, Ctrl and scroll to zoom.
vm-partner → vm-web:443should work: blocked by a network security groupvm-partner → vm-web:22should stay blocked: blocked, as it should be
Goals 0/4
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$