Implement and manage virtual networking
Three questions every connection must answer: path, permission and delivery
A virtual machine (VM) in one virtual network cannot reach a database server in another, and three fixes look equally plausible: a route, a security rule, or a DNS record. Each fix answers a different question, and this domain is easiest to learn as those three questions (an orienting model, not Azure terminology). Path asks whether packets can get there at all: a virtual network is your private network in Azure, Azure routes traffic between its subnets by default, and peering, VPN connections, route tables and outbound methods such as a NAT gateway extend or redirect those paths. Permission asks whether, and through which controlled way in, traffic may reach a target (traffic permission, not the Azure role permissions that decide who may change these resources): a network security group (NSG) holds security rules that allow or deny traffic to and from resources, and Azure Bastion, service endpoints and private endpoints are controlled ways in to VMs and Azure services. These also carry traffic, but sit under Permission because their job is to limit who or what reaches the target; a VPN gateway, by contrast, can be used to send encrypted traffic between an Azure virtual network and on-premises locations over the public internet; see Configure and manage virtual networks in Azure. Delivery asks where a request lands: Azure DNS translates a name to an IP address, and Azure Load Balancer distributes the flows that arrive at its frontend to the VMs in a backend pool. The classic trap is a fix taken from the wrong question. An NSG allow rule makes no path, so VMs in a private subnet (a subnet with default outbound access disabled) still need an explicit outbound method such as a NAT gateway to reach the internet. A peering makes no name resolvable, because VMs in two virtual networks resolve each other's names only through a private DNS zone, Azure DNS Private Resolver or your own DNS servers.
The domain unfolds in three steps, one per question
Configure and manage virtual networks in Azure covers the Path question: the address space and its subnets, network interfaces and public IP addresses, virtual network peering, site-to-site and point-to-site VPN connections through Azure VPN Gateway (a whole on-premises site, or one remote computer), user-defined routes (UDRs) in route tables, explicit outbound access, and the order in which to troubleshoot connectivity; reach for it whenever traffic has no way to get somewhere or must take a different route. Configure secure access to virtual networks covers the Permission question: NSG rules written with service tags (Microsoft-maintained sets of a service's IP prefixes) and application security groups (ASGs, groups of your own VMs' network interfaces), reading the effective security rules, Azure Bastion, service endpoints (a subnet setting under which the subnet's traffic reaches the service from private source IP addresses) and private endpoints (a network interface with a private IP address in your subnet for one target subresource, such as one storage account's blob service) for Azure platform as a service (PaaS) offerings; reach for it whenever traffic must be allowed, blocked or restricted, or needs a controlled way in. Configure name resolution and load balancing covers the Delivery question: public and private Azure DNS zones, which DNS servers a virtual network uses, Azure DNS Private Resolver, and public and internal load balancers with their rules, health probes and troubleshooting; reach for it whenever a name resolves to the wrong address or the wrong VM receives the traffic. Path and Permission are separate checks, and two of Azure Network Watcher's network diagnostic tools test them: Next hop (a tool, not a route's next hop type) checks whether traffic is routed correctly, and IP flow verify whether a packet is allowed or denied.
When two answers both work, prefer the one that gives the internet the fewest ways in
Prefer the answer that leaves the fewest inbound openings from the internet while still meeting the requirement. Administrators who need only Remote Desktop Protocol (RDP) or Secure Shell (SSH) sessions can use Azure Bastion, which connects to VMs by their private IP addresses so the VMs need no public IP address. VMs that need only outbound internet access get a NAT gateway on their subnet, which does not permit unsolicited inbound connections from the internet. A subnet that must reach one storage account's blob service gets a private endpoint, not a service endpoint, under which the service name still resolves to its public IP addresses; the private endpoint allows only connections that reach its target, and each further target subresource, such as file, needs its own. One boundary: a private endpoint does not necessarily restrict public network access, so disable it separately; only then does the service reject connections through its public endpoint, leaving the fewest ways in.
Path, Permission and Delivery: what each question decides
| Question | Decides | Key settings | Drill into |
|---|---|---|---|
| Path | Whether packets can get there at all: between subnets, between virtual networks, to on-premises networks and to the internet | Address space and subnets, network interfaces, public IP addresses, virtual network peering, VPN Gateway, route tables with UDRs, NAT gateway | Configure and manage virtual networks in Azure |
| Permission | Whether, and through which controlled way in, traffic may reach a target such as a VM or a PaaS service | NSG rules with service tags and ASGs, effective security rules, Azure Bastion, service endpoints, private endpoints | Configure secure access to virtual networks |
| Delivery | Where a request lands: the IP address a name resolves to, and the VM that receives each flow behind a load balancer frontend | Public and private DNS zones, a virtual network's DNS servers, Azure DNS Private Resolver, public and internal load balancers, load balancer rules, health probes | Configure name resolution and load balancing |