Networking Outbound connectivity premium field-manual-complete

NAT Gateway

NAT Gateway is the outbound internet door for private resources in an Azure subnet. It lets virtual machines, App Service regional VNet integration, AKS nodes, or other subnet-connected workloads reach public endpoints without assigning public IP addresses to each resource. The gateway performs source network address translation, so outside systems see the gateway public IP or prefix. In plain English, it gives a subnet a controlled, scalable, and predictable way to call the internet while staying private from inbound traffic.

Aliases
No aliases mapped yet
Difficulty
fundamentals
CLI mappings
5
Last verified
2026-05-30

Microsoft Learn

NAT Gateway is the outbound internet door for private resources in an Azure subnet. It lets virtual machines, App Service regional VNet integration, AKS nodes, or other subnet-connected workloads reach public endpoints without assigning public IP addresses to each resource. The gateway performs source network address translation, so outside systems see the gateway public IP or prefix. In plain English, it gives a subnet a controlled, scalable, and predictable way to call the internet while staying private from inbound traffic.

Microsoft Learn: What is Azure NAT Gateway?2026-05-30

Technical context

Technically, NAT Gateway sits in the networking and data-plane path of a virtual network subnet. You create a NAT gateway, attach one or more public IP addresses or prefixes, then associate it with a subnet. New outbound flows from resources in that subnet use the gateway for internet destinations unless a user-defined route sends traffic elsewhere. It interacts with route tables, Azure Firewall, load balancer outbound rules, private subnets, SNAT port allocation, availability zones, and monitoring data such as outbound flow visibility.

Why it matters

NAT Gateway matters because outbound connectivity is often an afterthought until production traffic fails, third-party allowlists break, or SNAT ports are exhausted under load. Many teams want private workloads, but those workloads still need package repositories, SaaS APIs, identity endpoints, update services, and partner systems. NAT Gateway gives architects a predictable egress identity and operators a cleaner place to scale and observe outbound flows. It also removes the weak pattern of assigning public IP addresses to workloads only for outbound access. In regulated environments, the gateway becomes a control point for documenting which subnets can reach the internet and which public addresses external partners should trust.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In the subnet blade, NAT Gateway appears as the selected outbound connectivity resource, alongside address prefixes, network security groups, route tables, and delegation settings. during design reviews.

Signal 02

In CLI output, engineers see the gateway name, public IP associations, idle timeout, SKU, zones, subnet references, provisioning state, and resource ID. during change validation.

Signal 03

During partner onboarding, NAT Gateway shows up as a stable outbound public IP or prefix that external firewalls, SaaS platforms, and APIs must allowlist. before production cutover.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Give private subnets predictable outbound public IPs for partner allowlists without assigning public IP addresses to each workload.
  • Replace default outbound access or load balancer outbound rules before private subnet behavior breaks new virtual network deployments.
  • Reduce SNAT exhaustion risk for busy workloads that make many outbound internet connections from the same subnet.
  • Separate egress design by subnet so production, integration, and test workloads do not share the same external identity.
  • Document and audit outbound internet paths during security reviews, migrations, or incident investigations involving third-party APIs.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Payment allowlists stop breaking during node recycling

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A subscription billing platform in the ticketing industry ran AKS workloads in private subnets, but payment processors kept seeing changing source addresses after node pool maintenance and outbound rule changes.

Business/Technical Objectives
  • Use one predictable egress identity for payment APIs.
  • Remove public IP addresses from worker nodes.
  • Cut payment incident triage below fifteen minutes.
  • Document the outbound path for PCI evidence.
Solution Using NAT Gateway

The platform team created a NAT Gateway with a Standard public IP prefix dedicated to the production AKS subnet. Node pools stayed private, while new outbound payment connections used the gateway prefix. Network security groups continued to control subnet traffic, and Azure Firewall remained reserved for inspected corporate egress. The team added CLI checks in the release pipeline to verify subnet association before application rollout. They also documented the expected source prefix in the PCI evidence pack and supplied it to each payment provider. Network Watcher tests and synthetic payment probes ran after maintenance windows to prove new connections used the gateway path rather than older load balancer outbound rules.

Results & Business Impact
  • Payment provider allowlist changes dropped from nine per quarter to one planned annual review.
  • Failed payment authorization spikes during node recycling fell by 83 percent.
  • Mean time to prove egress source moved from forty minutes to six minutes.
  • The PCI network evidence request was answered with one exported gateway report.
Key Takeaway for Glossary Readers

NAT Gateway is valuable when private compute needs a stable outbound identity that partners and auditors can trust.

Case study 02

Build agents reach package feeds without public exposure

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A game studio moved self-hosted build agents into isolated Azure subnets, then discovered that dependency restores failed whenever public package repositories throttled or challenged unfamiliar source IPs.

Business/Technical Objectives
  • Keep build agents private with no inbound internet path.
  • Give package repositories a known source IP range.
  • Reduce failed nightly builds caused by outbound instability.
  • Separate production game egress from build-system egress.
Solution Using NAT Gateway

The infrastructure team deployed a dedicated NAT Gateway for the build subnet and attached a public IP prefix owned by the platform group. Route tables kept build traffic away from the production firewall path, while NSG rules limited agent communication to required ports. The DevOps pipeline used Azure CLI to capture gateway, subnet, and public IP prefix details before agent scale-out. Package feed owners allowlisted the prefix and removed several per-agent exceptions. The team also tuned build tools to reuse connections so the gateway handled bursty restores without unnecessary connection churn.

Results & Business Impact
  • Nightly build failures tied to outbound connectivity fell from 17 percent to under 3 percent.
  • Public IPs on build VMs were eliminated across four studios.
  • Package feed allowlist entries were reduced from 64 agent addresses to one prefix.
  • Build-network incident handoffs dropped because ownership and routing were documented.
Key Takeaway for Glossary Readers

A NAT Gateway can make ephemeral automation infrastructure private, predictable, and easier to operate at scale.

Case study 03

Outbound migration avoids private subnet surprise

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A municipal software provider created new virtual networks for a modernization program and found that test VMs no longer had implicit outbound internet access for updates and license activation.

Business/Technical Objectives
  • Create an explicit outbound method for every private subnet.
  • Avoid VM-level public IP assignments.
  • Keep internet egress separate by environment.
  • Finish migration before the next security review.
Solution Using NAT Gateway

The network team standardized a NAT Gateway pattern for application subnets, one gateway per environment, and a documented exception process for workloads that required firewall inspection. They used Azure CLI inventory to find subnets with no explicit outbound path, then associated the correct gateway during scheduled windows. Update and license activation tests were added to the VM image validation checklist. The team also recorded route tables, subnet associations, gateway IDs, and public IP addresses in the configuration management database so future virtual network builds did not depend on implicit platform behavior.

Results & Business Impact
  • All 42 private subnets received an approved outbound pattern within three weeks.
  • VM public IP assignments for maintenance access dropped to zero.
  • Patch activation failures in new environments disappeared after the rollout.
  • Security review time for subnet egress evidence fell from two days to three hours.
Key Takeaway for Glossary Readers

NAT Gateway turns outbound access into an intentional architecture choice instead of a hidden platform assumption.

Why use Azure CLI for this?

I use Azure CLI for NAT Gateway because outbound failures usually need fast proof, not screenshots. After years of Azure operations, I want to see the gateway SKU, public IP bindings, subnet associations, idle timeout, zone choice, and route-table context in one repeatable workflow. Portal blades are fine for a first build, but CLI makes it practical to compare every production subnet, export partner allowlist evidence, and validate that a change did not move egress unexpectedly. CLI is also safer for migrations from default outbound access because I can inspect dependencies before updating subnets and preserve a clear change record.

CLI use cases

  • List every NAT gateway in a subscription and map each gateway to its public IP addresses, prefixes, and attached subnets.
  • Show a subnet before and after association to prove the expected NAT gateway is now the outbound path.
  • Export gateway properties for partner allowlisting, including public IP resource IDs, SKU, zones, and idle timeout.
  • Compare route tables and subnet configuration when outbound traffic unexpectedly bypasses the gateway.

Before you run CLI

  • Confirm the tenant, subscription, resource group, virtual network, subnet name, and whether the command only reads or changes subnet association.
  • Check permissions on both the NAT gateway and subnet because network contributor rights may be needed across separate resource groups.
  • Review public IP SKU, zone requirements, route tables, and maintenance windows before associating or replacing gateway resources.
  • Use explicit output formats and save before-state evidence because outbound egress changes can affect external allowlists immediately.

What output tells you

  • Gateway output shows SKU, idle timeout, zones, public IP and prefix references, provisioning state, tags, and the resource ID to use in automation.
  • Subnet output confirms whether the NAT gateway association exists and whether route tables or delegations may influence the effective egress path.
  • Network test and activity-log output helps identify when a change happened, who made it, and whether new outbound flows use the expected source path.

Mapped Azure CLI commands

NAT Gateway discovery

discovery
az network nat gateway list --resource-group <rg> --output table
az network nat gatewaydiscoverNetworking
az network nat gateway show --resource-group <rg> --name <nat-gateway-name>
az network nat gatewaydiscoverNetworking
az network vnet subnet show --resource-group <rg> --vnet-name <vnet> --name <subnet>
az network vnet subnetdiscoverNetworking

NAT Gateway association

change
az network vnet subnet update --resource-group <rg> --vnet-name <vnet> --name <subnet> --nat-gateway <nat-gateway-id>
az network vnet subnetconfigureNetworking
az network public-ip show --resource-group <rg> --name <public-ip-name>
az network public-ipdiscoverNetworking

Architecture context

In architecture reviews, I treat NAT Gateway as the subnet-level egress primitive, not as a firewall. It answers how private compute reaches public destinations with stable source addresses and scalable SNAT, but it does not inspect payloads or make application security decisions. In a hub-and-spoke design, I decide whether workloads should egress directly through a subnet NAT gateway, through Azure Firewall, or through a virtual appliance controlled by route tables. The decision depends on inspection requirements, partner allowlists, zone strategy, IPv4 or IPv6 needs, and blast radius. NAT Gateway is strongest when a workload needs predictable internet egress without exposing individual instances.

Security

Security improves because resources in a NAT Gateway subnet do not need public IP addresses only to reach the internet. The gateway blocks unsolicited inbound internet connections, but it is not a firewall and does not replace network security groups, private endpoints, application controls, or outbound filtering. Treat the associated public IPs as an egress identity that partners may allowlist and attackers may observe. Lock down who can change subnet associations, public IP prefixes, and route tables. Monitor changes because moving a subnet away from the approved gateway can silently bypass allowlists, logging expectations, or data-exfiltration reviews. Review these changes during release windows, not only after incidents.

Cost

NAT Gateway has direct cost through the gateway resource, processed data, and attached public IP addresses or prefixes. Indirect cost appears when teams overprovision gateways for every small subnet, duplicate egress designs across spokes, or retain public IP prefixes that are no longer needed. The opposite mistake is underdesigning egress and paying for incident time when SNAT pressure or partner allowlist drift causes outages. FinOps reviews should connect gateway ownership to the workloads using the subnet. Compare direct NAT cost with firewall inspection needs, load balancer outbound rules, public IP sprawl, and operational support effort. Tag gateways with workload, environment, and cost-center owners for review.

Reliability

Reliability depends on choosing the right SKU, public IP capacity, zone design, and routing model. NAT Gateway is managed and scales SNAT ports automatically, but poor design can still create outages if subnets share too few public addresses, if routes bypass the gateway, or if a migration interrupts critical outbound dependencies. Standard gateways are zonal or nonzonal, while newer zone-redundant options change the failure model. Operators should validate outbound dependencies before association changes, watch connection patterns, and plan rollback. Existing flows may continue through older paths during migration, so post-change testing must verify new connections, not just established sessions. Health checks should open new outbound connections from each critical subnet.

Performance

Performance is affected by outbound throughput, SNAT port availability, connection churn, idle timeout, and the destination pattern of the workload. NAT Gateway is designed to scale outbound connectivity, but applications that open many short-lived connections to the same destination can still expose inefficient client behavior. Route tables and virtual appliances can add latency if traffic is intentionally forced through inspection before or instead of NAT. Operators should test throughput and connection reuse under realistic load, not only from a single VM. Tune application pooling, partner endpoints, and public IP capacity before blaming the gateway. Measure from several instances so subnet-wide behavior is visible.

Operations

Operators inspect NAT Gateway through subnet configuration, public IP resources, route tables, Network Watcher, metrics, diagnostic logs where available, and partner connectivity tests. Common jobs include proving which subnets use which gateway, confirming public IP prefixes, checking idle timeout, reviewing failed outbound calls, and documenting allowlist evidence. Changes should be made during controlled windows when workloads depend on long-lived TCP connections. Runbooks should include test endpoints, expected source IPs, known SaaS allowlists, route precedence, and rollback steps. Good operations also track ownership because egress problems cross application, network, security, and vendor teams quickly. Keep these checks in the same runbook as firewall and DNS evidence.

Common mistakes

  • Treating NAT Gateway as an outbound firewall even though it does not inspect traffic, enforce FQDN rules, or replace application security controls.
  • Associating the gateway without checking route tables, then wondering why default routes to a firewall or virtual appliance still control egress.
  • Changing egress IPs without notifying partner teams, which breaks allowlisted payment, identity, package, or data-transfer endpoints.
  • Testing only an existing TCP session after migration instead of opening new connections that prove the new gateway path is active.