The road around the desk
Everything in this track so far has assumed the caller comes through the front desk. Parts D and F built a very good desk — it authenticates, limits, and logs every request. None of it matters if there is a second door. By default APIM has a public IP and so, very often, does the backend behind it, which means a caller who learns the backend's address can skip the desk entirely: no key checked, no token validated, no rate limit, no log. The gateway becomes a suggestion. This is the failure that networking exists to close, and it is the one auditors reach for first, because it turns every control you built into theatre.
So the whole of this part answers one question in three settings: how do you make the gateway the only road to the backend? Sometimes that means the backend sits in a private network APIM can reach but the internet cannot. Sometimes it means clients themselves must arrive privately. And sometimes the backend will never leave your own building, and the gateway has to go to it. The vocabulary is small; the tier rules are where people get caught out, so learn them with the concept:
- VNet injection
- Deploying the whole APIM instance into a subnet of your virtual network, so it can reach private backends. Two modes — external and internal. A classic Developer / Premium capability.1
- External vs internal
- External: the gateway keeps a public endpoint but can also reach VNet resources. Internal: the gateway has no public endpoint — it is reachable only from inside the network.
- Private endpoint
- A private IP in your VNet for inbound client connections to APIM over Azure Private Link. Inbound only — it secures the road clients take in, not the road APIM takes out.
- Self-hosted gateway
- A containerised copy of the gateway you run yourself — on-premises or in another cloud — managed from your Azure instance. For backends that will never move to Azure. Developer / Premium.
- Application Gateway / Front Door
- A WAF-bearing front you put in front of an internal-mode APIM, so the public takes the internet-facing appliance and the gateway stays private behind it.
VNet injection — external and internal
The heaviest tool is virtual network injection: you deploy the entire APIM instance into a subnet of your VNet, and from there it can reach backends that have no public address at all — a database behind a private endpoint, an app service locked to the VNet, a server on-premises across a VPN or ExpressRoute. This is a classic Developer and Premium tier capability, and stating that tier gate correctly is the single most common thing candidates get wrong in an interview. It comes in two modes, and the difference is entirely about the front:
External mode keeps a public endpoint on the gateway — the internet can still call APIM directly — while giving it a foot inside the VNet to reach private backends. Use it when you want a public API whose backends happen to be private. Internal mode removes the public endpoint entirely: the gateway, the developer portal, and the management plane are reachable only from inside the network. Nothing on the internet can call it. That is the mode for an API that should never face the public directly — an internal platform, or one that will only ever be fronted by something else.
A desk you can walk around is a decoration.
One newer wrinkle worth knowing so you are not caught flat: the v2 tiers (Standard v2, Premium v2) added a separate, lighter model called VNet integration for outbound connectivity to private backends, keeping the gateway's inbound endpoint public. It is a different feature from classic injection, not a rename, and conflating the two is a common slip. For this class, hold the classic external/internal injection model as your default mental picture — it is what "VNet mode" almost always means — and know that a lighter outbound-only option exists on the v2 tiers.
Private endpoints, and fronting APIM with a WAF
Injection is about the road APIM takes out to backends. A private endpoint is about the road clients take in. It gives your APIM instance a private IP inside your VNet via Azure Private Link, so a client on the network reaches the gateway without ever touching a public address — and you can then disable public network access entirely, so the only way to the gateway is the private one. The detail that catches people: a private endpoint on APIM is inbound only. It secures how clients connect to the gateway; it does nothing for how the gateway connects to its backends. Inbound private endpoint and outbound reachability are two separate problems, solved by two separate features, and an interviewer will happily watch you conflate them.
The most common production shape combines internal mode with a public front. You put APIM in internal mode — no public endpoint — and place an internet-facing Application Gateway (or Azure Front Door) in front of it. The public reaches the WAF-bearing appliance; the appliance forwards to the private gateway; the gateway alone reaches the backend. You get a web application firewall inspecting traffic before it ever reaches APIM, a public entry point you can harden and scale independently, and an API gateway that has no direct exposure to the internet at all. Front Door adds global anycast and CDN-style edge presence for a geographically spread audience; Application Gateway is the regional, in-VNet choice. This is the pattern Figure 1 draws, and it is worth being able to sketch on a whiteboard in four boxes.2
The self-hosted gateway — when the backend can't move
Every option so far assumes the backend can be reached from Azure. Some cannot — a mainframe in a data centre that will never be migrated, a service in another cloud, a system a regulator says must stay in a particular building. Routing those calls up to Azure and back down is slow, sometimes non-compliant, and occasionally billed by the gigabyte. The self-hosted gateway answers this by inverting the geometry: it is a containerised copy of the gateway — a Linux Docker image you run on Docker, Kubernetes, or Azure Arc, on-premises or in another cloud — that you deploy beside the backend. API traffic then flows directly from caller to local gateway to local backend, never leaving the building, while the gateway is still managed, configured, and observed from your single Azure APIM instance. It is a Developer and Premium feature.
Two facts about it earn their keep. First, connectivity: the self-hosted gateway needs only outbound connectivity to Azure on port 443 — it reaches out to a configuration endpoint to pull policy updates every few seconds and to send heartbeats and telemetry (to Azure Monitor and Application Insights). You never open an inbound hole from Azure into your data centre; the container phones home. Second, resilience: it is designed to fail static. If the link to Azure drops, a running gateway keeps serving traffic from its in-memory (or backed-up) configuration, and reconnects and catches up when Azure returns. A network blip in your Azure region does not stop your on-premises API. It is the answer to "single point of management, many places the APIs actually live."
A gateway with no front door, and one that travels
Campux's catalog backend used to sit on a public app service, and the day someone found its address and called it directly — skipping every rate limit the partners were bound by — is the day this part became non-negotiable. The fix is the four-box shape: APIM moves to internal mode with no public endpoint, the backend loses its public address and sits behind a private endpoint the gateway reaches from inside the VNet, and an Application Gateway with a WAF becomes the one public front. Now the only route to the catalog runs through the WAF, through the gateway, past the key and token checks of Parts E and F. The address that used to be callable returns nothing from the internet; there is no road around the desk left to find.
The warehouse is the other half of the story. Its stock system is a decade-old server that legal says stays in the building, so Campux runs a self-hosted gateway in the warehouse's own rack. Stock lookups from the in-store tills hit the local gateway and the local server and never round-trip to Azure — faster, and compliant — while the policies, keys, and analytics are still managed from the one Azure instance the team already knows. When the site's uplink flickers during a storm, the tills keep scanning: the gateway fails static, serving its last-known configuration until Azure comes back. One control plane; two very different buildings.
The only road in
Networking is where the gateway stops being advice and becomes architecture. A desk you can walk around is a decoration; a desk that is the sole path to the backend is a control. You now have the three moves that guarantee it: injection so APIM can reach private backends, internal mode plus a WAF-bearing front so clients cannot reach the gateway's backend directly, and the self-hosted gateway for the servers that will never come to the cloud — each with a tier gate worth stating precisely, because the wrong tier is the wrong answer. What is left is the thing every change to a public contract needs: a way to alter the API without breaking the strangers who depend on it, and the instruments to see who is calling what. That is Part H.
The backend nobody knew was public
The security team's report has one finding that matters: they reached the catalog backend on its public address without ever presenting a key, and pulled data at a rate the partner product would have throttled ten times over. Every control you built — keys, JWT, rate limits — was intact and irrelevant, because there was a road around the desk. The fix is not another policy; it is network shape. You move APIM into internal mode, strip the backend's public IP and put it behind a private endpoint the gateway reaches from inside the VNet, and stand up an Application Gateway with a WAF as the single public front. Then you re-run the test: the old backend address answers nothing from the internet, and the only successful path is through the WAF, through the gateway, past the checks. The lesson you write in the postmortem: authentication that can be bypassed at the network layer is not authentication — it is a sign on an open door.
Examination
Four drills, then two situations. The situations have no marking scheme — write your answer before you reveal the reasoning, or the exercise is worthless. Nothing is stored; this is between you and the page.
B — internal mode is the one with no public endpoint. Internal mode puts the gateway, portal, and management plane inside the VNet only, which is exactly what you want behind an Application Gateway or Front Door. A inverts the two: external mode keeps a public endpoint while also reaching VNet resources — the opposite of what was asked. C confuses a tier with a mode; the Consumption tier is not private-by-default and does not offer classic injection at all. D is the most tempting miss and the one worth burning in: a private endpoint secures inbound client connections to APIM, it is inbound-only, and it does not change the gateway's mode or govern how APIM reaches its backends. Mode and endpoint are different levers; reaching for the wrong one is how a "private" gateway ends up still answering the internet.
B — the self-hosted gateway inverts the geometry: the gateway goes to the backend. A container of the data plane runs in the warehouse rack, traffic flows caller-to-local-gateway-to-local-server without leaving the building, and it is still configured and observed from the one Azure instance over a single outbound 443 connection — failing static if that link drops. A defeats the whole purpose by routing every call up to Azure and back, which is the latency and compliance problem you were avoiding. C misreads the tool: a private endpoint is an inbound Azure-side construct, not a way to reach an arbitrary on-premises box. D throws away the single-control-plane benefit — a second full instance is a second thing to license, configure, and drift, which is precisely what the self-hosted gateway exists to avoid.
The tier gate, the inbound-only endpoint, and the outbound-only self-hosted gateway. Those three are the facts people state wrong under pressure, so they are the ones worth being exactly right about: classic injection is Developer/Premium, a private endpoint is inbound-only, and the self-hosted gateway phones home over outbound 443 and keeps serving if the line breaks. The two false statements are the classic conflations. Internal mode removes all public endpoints — including the portal and management plane — so "still exposes a public endpoint" is exactly what internal mode does not do. And a private endpoint does not replace injection: it secures the inbound road for clients, while injection is what lets APIM reach private backends on the outbound side. Inbound and outbound are two problems; do not let one word cover both.
# private api platform — network design
1. APIM deployed in internal VNet mode:
no public endpoint on the gateway.
2. Backend has no public IP; reached via a
private endpoint from inside the VNet.
3. Backend also keeps its old public IP enabled
as a fallback, "just in case."
4. Application Gateway with WAF is the one
public front; forwards to internal APIM.
Line three — and it silently undoes lines one, two, and four. The entire point of internal mode, the private endpoint, and the WAF front is that the only route to the backend runs through the desk. Leaving the backend's public IP enabled "just in case" is precisely the road around the desk: anyone who learns that address skips the WAF, the gateway, the keys, and the rate limits, and the pen-test finds it in an afternoon. "Fallback" is the word that should trigger the alarm — a fallback path that bypasses every control is not resilience, it is the vulnerability. The distractors are the design working: internal mode is real and correct (A), a private endpoint is the right way to reach the backend (B), and a WAF in front of a private APIM is the recommended pattern, not redundancy — it inspects traffic before the gateway ever sees it (D). Delete line three and the platform is actually private.
The trap is one word — "private" — covering two different roads. Grant the true part: a private endpoint is real and useful, and it does solve half the problem. It gives APIM a private inbound IP over Private Link, and once you disable public network access, clients can only reach the gateway from inside the network. That is the inbound road, and their plan secures it. But a private endpoint is inbound-only by design; it says nothing about how APIM reaches its backends, and nothing about whether the backend is still sitting on a public IP of its own. "Everything's private" is exactly the overreach an interviewer listens for.
Then name the road left open. If the backend keeps a public address, the whole exercise is theatre: a caller who learns that address skips the now-private gateway entirely, and you have secured the front door of a house with an open back gate. The outbound side is a separate feature — VNet injection (or v2 VNet integration) so APIM can reach a backend that has no public IP and lives behind its own private endpoint. Two roads, two mechanisms; a private endpoint on APIM covers one of them.
Close with the shape that actually delivers "private." Propose the four-box design: APIM in internal mode (or with public access disabled), the backend stripped of its public IP and reached privately from inside the VNet, and a WAF-bearing front — Application Gateway or Front Door — as the single hardened public entry. Now the only route in runs through the WAF, through the gateway, past the checks, and there is no public backend address to find. Private is not one toggle; it is the guarantee that the gateway is the only road, proven on both the inbound and outbound sides.
Lead with the principle: one control plane, gateways where the backends live. "I keep a single Azure APIM instance as the place I author policies, issue subscriptions, and read analytics — one control plane — and I put the data plane wherever the backend actually is. That is the whole reason the self-hosted gateway exists, and it is what keeps this from becoming three products to operate." Saying that first shows you are designing a system, not stacking features.
Then map each backend to a mechanism. "The Azure-hosted services I reach with VNet injection — APIM in the VNet, backends behind private endpoints, no public IPs. The other cloud and the immovable data centre each get a self-hosted gateway: a container of the gateway running beside those backends, so traffic stays local — lower latency, and compliant — while it pulls its configuration and ships telemetry to my one Azure instance over outbound 443, and fails static if that link blips. Callers never round-trip to Azure just to reach a server that sits next to them."
Close by being precise about tiers, because the question demanded it. "Both the classic external/internal VNet injection and the self-hosted gateway are Developer and Premium tier features — so a design that leans on either lives on Premium in production, with Developer for non-prod. If someone wants this on a cheaper tier, that is the constraint that has to give, and I would rather say so up front than discover it at deployment." Naming the tier gate without being asked twice is the detail that separates someone who has built this from someone who has only read the marketing page.
Five things worth carrying out of this part
- Authentication that can be bypassed at the network layer is not authentication. The whole of networking answers one question: how do you make the gateway the only road to the backend?
- VNet injection puts APIM inside your network to reach private backends. External keeps a public endpoint; internal removes it. Classic injection is a Developer / Premium capability — state the tier precisely.
- A private endpoint on APIM is inbound only — it secures how clients reach the gateway, not how the gateway reaches backends. Inbound and outbound are two problems; do not let one word cover both.
- The production shape for "private" is internal mode behind a WAF: an internet-facing Application Gateway or Front Door forwards to a gateway with no public endpoint, which alone reaches a backend that has no public IP.
- The self-hosted gateway is a container of the data plane run beside a backend that can't move to Azure — managed from one Azure instance over outbound 443, failing static if the link drops. Also Developer / Premium.
- Tier and networking rules are the part of APIM that shifts most between releases, so treat the specifics with suspicion and the direction as settled. As of this writing, classic external/internal VNet injection and the self-hosted gateway are Developer/Premium; the v2 tiers (Standard v2, Premium v2) added their own outbound VNet integration and a Premium v2 injection variant, and inbound private endpoints span a wider set of tiers. Microsoft moves these lines; before you commit an architecture to a tier, confirm the current matrix on Microsoft Learn rather than trusting any single page — including this one. ↩
- Front Door and Application Gateway are not interchangeable, and choosing between them is its own decision covered in the Class 13 traffic notes: Front Door is a global, anycast, edge-of-network service (good for a geographically spread audience and CDN-style caching); Application Gateway is a regional, in-VNet load balancer with a WAF (good for a single-region internal-mode APIM). Both can front APIM; which you pick follows from where your callers are, not from which has the newer name — the trade-offs are laid out in the Front Door vs Application Gateway note. ↩