The Azure API Management self-hosted gateway is a container you run in your own environment that applies the same policies as the managed gateway while staying managed from your Azure instance. Use it when API traffic must stay next to the backend for latency, data transfer cost or compliance. It is available in the Developer and Premium tiers, and it still needs outbound connectivity to Azure.
It is the on-premises pattern behind our Azure API Management page. All facts below come from Microsoft's self-hosted gateway overview, checked November 2026.
When on premises
| Situation | Self-hosted gateway fits? | Why |
|---|---|---|
| Backends in a data center, clients inside it | Yes | Traffic stays local; lower latency and data transfer |
| Data must not transit a public cloud region | Often | Only config and telemetry go to Azure; confirm what your policy allows |
| Several clouds and sites, one control point | Yes | One instance manages all gateways |
| Fully air-gapped network | No | Needs an outbound path to Azure |
| Small team, simple cloud-only APIs | No | The managed gateway is simpler |
Regulated teams also ask about on-premises AI gateways. The same split applies: policy and logging at a local gateway, configuration from the cloud. Confirm that each policy you rely on is supported in the self-hosted gateway before you design around it.
Setup
- Use a Premium instance for production. Developer is for testing and has no SLA.
- In the Azure portal, create a gateway resource and assign APIs to it.
- Choose how the gateway authenticates to Azure (see Microsoft's authentication options) and keep the token or key in your secret store.
- Deploy the container image to Kubernetes with the Helm chart, or to Docker. Pin an exact version tag in production, not a rolling tag such as v2.
- Turn on local configuration backup with a persistent volume so a restart during an outage works.
- Send traffic through a test API and watch the heartbeat in the portal.
Connectivity
- Outbound TCP 443 to the instance's configuration endpoint, and to the instance IP address.
- Optional endpoints for Application Insights, Azure Monitor, Entra ID and storage, depending on features.
- Heartbeats every minute and configuration checks every 10 seconds, per Microsoft's documentation.
- In an internal network, private connectivity to the configuration endpoint needs private DNS or a custom hostname through Application Gateway.
Ask the network team for a named allow list early. Public IP addresses behind some endpoints change, so use hostnames or service tags where the firewall allows.
Operations
| Task | Practice |
|---|---|
| Version control | Pin image tags, upgrade one gateway first, keep a rollback tag |
| Scaling | Run at least two replicas per site; scale on CPU and request rate |
| Telemetry | Send metrics to Azure Monitor or use local metrics; plan for gaps if the link drops |
| Outage test | Cut the link in a test and confirm running and restarted gateways behave as documented |
| TLS | Check supported protocols and ciphers; TLS 1.2 is the default |
| Limits | TLS session resumption and client certificate renegotiation are not available; present client certificates in the initial handshake |
Where it can go wrong
- A rolling image tag upgrades some pods and not others during scaling.
- A firewall rule blocks the configuration endpoint after a change window.
- A policy that works in the managed gateway is not supported in the self-hosted one.
- Nobody owns the container platform that now hosts a critical gateway.
A pre-production test plan
| Test | Pass when |
|---|---|
| Cut the link to Azure with traffic running | Traffic continues without errors |
| Restart a gateway during the cut | It starts from the local backup, if you enabled one |
| Restore the link | Configuration changes made during the cut arrive |
| Roll out a new image | No dropped requests with two or more replicas |
| Revoke the gateway's credential | It stops receiving configuration and the alert fires |
| Fail a backend | Policies return the designed error |
Keep the results with the change record. For regulated workloads, this is the evidence an examiner asks for when they want to know what happens if the cloud link fails.
Sizing and placement
Place one gateway group per site that holds backends, not one per application. Size from measured request rate and payload size, and test with your heaviest policy set, since policies such as validation and transformation add CPU. Start with two replicas per site, set resource requests from the test, and revisit after a month of real traffic. Keep the gateway in the same network zone as the backends it serves so that traffic does not cross a firewall twice.



