Allow a subnet through a storage firewall
- Get vm-app through to stdata02 on 443
The storage account stdata02 only accepts selected networks, and vm-app's subnet, vnet-app/subnet-app, isn't one of them yet, so vm-app gets 403. Let subnet-app in with a service endpoint and a virtual network rule. The card also compares this with private endpoints, which come up in later levels.
Connect to vm-app.
ssh vm-appWhat's this?
Opens a shell on vm-app, so the next commands run on that VM. In this lab it's a shortcut. In real Azure you'd connect through something like Azure Bastion, or SSH to an address you can reach.
Try the account. Expect 403. Type exit when done.
curl -sI https://stdata02.blob.core.windows.netWhat's this?
Fetches a web address and shows the reply. Tells you whether the web service itself answers, not just the port.
-squiet: no progress bar-Iask only for the headers, not the whole page
Turn on the service endpoint for subnet-app.
az network vnet subnet update -g rg-lab --vnet-name vnet-app --name subnet-app --service-endpoints Microsoft.StorageWhat's this?
Changes a subnet's settings, such as which NSG or route table is attached to it.
-gthe resource group the resources live in--vnet-namethe virtual network--namethe name of the thing to look at or change
Allow subnet-app on the account.
az storage account network-rule add -g rg-lab --account-name stdata02 --vnet-name vnet-app --subnet subnet-appWhat's this?
Adds a rule to a storage account's firewall: an IP range or a subnet that's allowed in. Network rules only take effect when the default action is Deny.
-gthe resource group the resources live in--vnet-namethe virtual network
Look for the new route type in vm-app's routes.
az network nic show-effective-route-table -g rg-lab --name vm-app-nic -o tableWhat's this?
Lists every route that applies to a VM's network interface: system routes, gateway routes and your route tables, and which are active.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Answer the question below.
?
- 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-app → stdata02.blob.core.windows.net:443should work: not working