Lock both doors. Most teams lock one.

Anuradha
November 24, 2026 22 mins to read
Lock Both Doors: Inbound and Outbound Isolation in Azure
Cloud Diary · Azure network security

Lock both doors.
Most teams lock one.

A private endpoint decides who can reach your service. It says nothing about what your service can reach. This post is about the second door, the one that stays open in most landing zones I look at.

Userson-prem / appsInternetany FQDNYour workloadapp, agent, PaaSINOUT✓ private endpointfront door locked✗ nothing checks itback door open
1
direction a private endpoint protects
3
private DNS zones Foundry needs
470
HTTP code Azure Firewall sends on deny
$0
cost of NSP access metrics
01

Two doors, two different locks

Inbound and outbound are separate problems. They use different features and they fail in different ways.

INBOUND · FRONT DOOR

Who can reach my service?

  • Private endpoint and private DNS
  • Public network access off
  • NSP inbound rules

Most teams get this right. It is in every landing zone template.

OUTBOUND · BACK DOOR

What can my service reach?

  • Routes that force traffic to a firewall
  • An FQDN allowlist with default deny
  • NSP outbound rules for PaaS

This is the one that gets skipped. Data leaves through this door.

A Microsoft architect wrote about this in September after locking down Azure AI Foundry. His point: the private endpoint secures traffic going in and does nothing about the traffic your agents send out. If you stop after the private endpoint, the setup looks finished. It is half done. Based on "Your Private Endpoint Does Not Cover Agent Egress", Azure Architecture Blog. One of the most-read posts on the Azure Architecture Blog in recent weeks.
02

Find your leaks

Switch on the controls below that you have in production. Watch which paths close. The default is what I see most: private endpoint done, public access off, and nothing on the way out.

SPOKE VNETNETWORK SECURITY PERIMETERDNS queryInternetany FQDNOutside storageattacker-ownedAttackerstolen key / tokenOn-prem usersVPN / ExpressRouteApp / agentApp Svc, AKS, VMAzure FirewallFQDN allowlistDNS resolverPrivate ResolverPrivate endpoint10.20.4.5Azure SQLPaaSStoragePaaS……………
openbroken or bypassedprivatelocked

Try turning on the firewall without routing the app into it. The path goes amber. I see this a lot. The firewall is deployed, it shows up in the diagram, and the app traffic walks right past it.

03

The lock for each workload

Each service type has its own switch for the back door. Pick yours.

IN

Who can reach it

  • Private endpoint on the app.
  • Public network access set to Disabled.
  • Public apps go through App Gateway WAF or Front Door Premium with a Private Link origin.
OUT

What it can reach

  • Regional VNet integration on a dedicated subnet.
  • Turn on Outbound internet traffic (Route All) so internet calls enter the VNet.
  • UDR 0.0.0.0/0 to the firewall private IP on that subnet.
⚠

Without Route All, only private (RFC 1918) traffic goes into the VNet. Internet calls leave Azure directly and never touch your firewall.

IN

Who can reach it

  • Private cluster so the API server has no public IP.
  • Internal load balancer for services. App Gateway WAF for anything public.
OUT

What it can reach

  • outboundType: userDefinedRouting.
  • Azure Firewall with the AzureKubernetesService FQDN tag plus your own allowlist.
⚠

Allow the AKS required FQDNs before you switch egress. If you don't, new nodes fail to join and the upgrade you ran on Friday night stalls.

IN

Who can reach it

  • No public IPs on NICs. Enforce it with Azure Policy.
  • Admin access through Bastion or JIT.
OUT

What it can reach

  • UDR 0.0.0.0/0 to Azure Firewall.
  • NAT gateway only when you need a fixed IP. It filters nothing.
  • Apps that already use proxy settings can point at Azure Firewall explicit proxy (GA September 2026) instead of changing routes.
⚠

Azure is retiring default outbound access for VMs. Give every subnet an explicit way out, and make sure it is the one you control.

IN

Who can reach it

  • Private endpoint and public network access Disabled.
  • Three private DNS zones: privatelink.openai.azure.com, privatelink.services.ai.azure.com, privatelink.cognitiveservices.azure.com.
OUT

What it can reach

  • Network injection (Standard setup with your own VNet).
  • Delegated subnet Microsoft.App/environments, routed to your firewall.
⚠

Network injection is set at creation time only. You can't add it to an existing account, so decide before you deploy.

IN

Who can reach it

  • Private endpoint plus public access Disabled.
  • Or NSP in Enforced mode (publicNetworkAccess = SecuredByPerimeter).
  • Disable shared key access on storage so a leaked key is useless.
OUT

What it can reach

  • NSP outbound access rules with an FQDN allowlist.
  • Azure SQL outbound firewall rules (Restrict outbound networking).
⚠

"Allow trusted Microsoft services" is still a door. Check which services it lets in and turn it off where you don't need it.

Building AI agents? Same back door.

Microsoft's new reference for governing agents across tenants has an AI gateway that checks every model and tool call. The gateway is only mandatory because they block direct network egress from the agent runtime. Without that block, an agent can call a model or tool directly and skip every policy check. They also block unapproved agent services at egress.

So the governance story for agents still starts with a plain old route table and a firewall rule.

04

Roll out NSP without breaking prod

Network Security Perimeter puts a boundary around PaaS services and controls both doors. NSP access metrics went GA on 30 September 2026. That gives you a free way to see what Enforced mode would block before you turn it on.

  1. 1Associate in Transition modeCreate the perimeter and a profile. Add your Storage, Key Vault and SQL. Nothing breaks. Existing resource firewall rules still apply.
  2. 2Open the metricsSplit by direction and access mode. Metrics are free and need no setup.
  3. 3Turn on logs where you need namesMetrics give you counts. Logs tell you who and which rule. Logs cost money, so be selective.
  4. 4Watch one full business cycleInclude month-end jobs and backups. Add inbound rules (subscriptions, IP ranges) and outbound FQDN rules for what is real.
  5. 5Switch to EnforcedAnything without a matching rule is now denied, in and out.
  6. 6Alert on deniedA new denied source after enforcement is either a broken app or someone knocking. Both need a look.
0200400600TRANSITIONADD RULESENFORCED1234567891011121314alert: new denied sourceday
Illustrative 14-day view. Cyan bars are approved requests, red bars are denied. The red drops once the real traffic has rules.
NSP resource → Monitoring → Metrics → Metric namespace: NSP access metrics
Metrics
Free, near real time, works with alerts and workbooks. Counts and trends only.
Diagnostic logs
Per-request detail for forensics. Needs Log Analytics or storage, which you pay for.
05

Prove it, both ways

A diagram is a claim. A log line is evidence. Run all four tests. az vm run-command needs no public IP and no Bastion, but it runs under /bin/sh, so keep the scripts simple.

1Inside resolves privateexpect 10.x.x.x
az vm run-command invoke -g rg-spoke -n vm-test \
  --command-id RunShellScript \
  --scripts "nslookup stcontoso.blob.core.windows.net"

You want a private IP through the privatelink alias. A public IP here means a DNS zone or zone group is missing.

2Outside gets refusedexpect 403
curl -s -o /dev/null -w "%{http_code}\n" \
  "https://stcontoso.blob.core.windows.net/data?restype=container&comp=list"

Run this from your laptop. A 200 from inside plus a 403 from outside is proof. A 200 from inside alone proves nothing.

3Allowed egress uses your pathexpect firewall IP
az vm run-command invoke -g rg-spoke -n vm-test \
  --command-id RunShellScript \
  --scripts "curl -s https://api.ipify.org"

Allow this FQDN for the test only. The answer should be your firewall public IP, not a random Azure address.

4Unknown egress gets deniedexpect 470
az vm run-command invoke -g rg-spoke -n vm-test \
  --command-id RunShellScript \
  --scripts "curl -s -o /dev/null -w '%{http_code}' http://example.org"

Azure Firewall answers a denied HTTP request with status 470. For HTTPS you get a reset. Either way, check the deny shows up in the logs.

06

Real breaches, one open door

None of these needed anything clever at the network layer. A door was open, and the attacker used it.

DOOR: OUTDec 2020

SUNBURST (SolarWinds)

A poisoned Orion update put a backdoor into about 18,000 organisations. Infected servers called home over HTTPS to subdomains of avsvmcloud.com.

The open door: A monitoring server almost never needs the open internet. With deny-by-default egress, that call home becomes a firewall deny log instead of a working tunnel.

In Azure today
  • UDR 0.0.0.0/0 to Azure Firewall on server subnets
  • Application rules for known FQDNs only
  • Alert on new denied FQDNs
DOOR: BOTHJul 2019

Capital One

A misconfigured WAF let an attacker make the server send requests for them (SSRF). They took cloud credentials from the instance metadata service, then copied storage data on about 106 million people.

The open door: The stolen credentials worked because the storage answered the internet. A locked inbound door would have turned them into a 403.

In Azure today
  • Storage public access Disabled or NSP Enforced
  • Disable shared key access
  • WAF in prevention mode, outbound filtered
DOOR: INAug 2025

Storm-0501

Microsoft reported the group moved from on-prem into Azure and gave itself Owner rights. It pulled data out of storage accounts with AzCopy, then deleted data and backups.

The open door: An Owner can change network settings. Locking the door once is not enough. You need a policy that keeps it locked and an alert when someone touches it.

In Azure today
  • Azure Policy Deny on public network access
  • NSP managed by the platform team, not the workload
  • Activity Log alert on storage network rule changes
07

Gotchas that cost an afternoon

Most of these come straight from people who built it and hit the wall.

01Foundry needs three DNS zones, not one

The endpoint answers on several FQDNs. If you only create the zone for the hostname you test with, the others quietly resolve to the public IP. Traffic still works, which is exactly why nobody notices.

02A private endpoint without a DNS zone group

The zone group is what writes the A records. Skip it and you get private DNS zones with nothing in them.

03On-prem can't query Azure private DNS

168.63.129.16 only works inside a VNet. Put a DNS Private Resolver inbound endpoint in the hub and add conditional forwarders on-prem. Forward only the privatelink.* zones, not the whole public zone.

04Foundry network injection is creation time only

The delegation is Microsoft.App/environments, and you need the Microsoft.App and Microsoft.ContainerService providers registered. You can't add injection to an account you already built.

05A 424 with empty server logs is not a network problem

On a network-injected Foundry account, external_connector_error with zero packets at your tool usually means the project-level capability host is missing. The account-level one is created for you. The project one is not.

06NAT gateway is not egress control

It gives you a fixed outbound IP. It does not filter anything. If you need an allowlist, you need a firewall or a proxy in the path.

07Testing only from inside

A 200 from inside the VNet fits perfectly with a resource that is also wide open to the internet. Always run the negative test too.

08

Queries to find the open doors

Run the ARG ones in Resource Graph Explorer across all subscriptions. The KQL ones need the firewall and NSP diagnostic logs in Log Analytics. Check the column names against your workspace schema before you build alerts on them.

ARGPaaS services still open to the internet
resources
| where type in~ ('microsoft.storage/storageaccounts','microsoft.keyvault/vaults',
    'microsoft.sql/servers','microsoft.cognitiveservices/accounts',
    'microsoft.documentdb/databaseaccounts')
| extend pna = tostring(properties.publicNetworkAccess)
| where pna !~ 'Disabled' and pna !~ 'SecuredByPerimeter'
| project name, type, resourceGroup, subscriptionId, pna
ARGSubnets with no route table and no NAT (no controlled way out)
resources
| where type =~ 'microsoft.network/virtualnetworks'
| mv-expand subnet = properties.subnets
| extend sname = tostring(subnet.name),
         rt  = tostring(subnet.properties.routeTable.id),
         nat = tostring(subnet.properties.natGateway.id)
| where sname !in~ ('GatewaySubnet','AzureFirewallSubnet',
                    'AzureBastionSubnet','RouteServerSubnet')
| where isempty(rt) and isempty(nat)
| project vnet = name, sname, resourceGroup, subscriptionId
KQLTop denied outbound FQDNs at Azure Firewall (last 24h)
AZFWApplicationRule
| where TimeGenerated > ago(24h) and Action == "Deny"
| summarize hits = count() by SourceIp, Fqdn
| top 20 by hits
KQLNSP denied traffic by category (needs NSP diagnostic logs)
NSPAccessLogs
| where TimeGenerated > ago(7d)
| where Category has "Denied"
| summarize hits = count() by Category, bin(TimeGenerated, 1h)
| render timechart
09

Both-doors checklist

Tick what you have in production today, not what is in the design document.

Front door0/5
Back door0/5

Next time someone says the workload is private, ask two questions. Who can reach it? And what can it reach? If the second answer is "anything", you have locked one door.

#Azure#AzureNetworking#PrivateLink#NetworkSecurityPerimeter#AzureFirewall#ZeroTrust#LandingZone#CloudSecurity

Leave a comment

Your email address will not be published. Required fields are marked *

Share