
Azure API ManagementAuthorCloudBrum editorial teamLast reviewedReading time~12 minLevelBeginner to advanced
Microsoft Azure · App modernization · API gateway and management
A gateway, a rulebook and a shop window for your APIs. Callers reach one address. APIM checks their key or token, applies the policies you wrote and forwards the call to your back end. Developers get a portal where they read the docs and pick up a key. Pricing depends on the tier, so choose that part carefully.
On this page (17 sections)
Mind map: Azure API Management at a glance
Free to share. The downloaded image includes the CloudBrum link.
Key features (summary)
- One address, many back endsAzure Functions, App Service, Logic Apps, containers, virtual machines and even on-premises services can sit behind one domain and one set of rules.
- Policies you can readBehaviour is written in XML that runs at four steps: inbound, backend, outbound and on-error. A rate limit or a token check is usually a line or two.
- Products and subscriptionsBundle APIs into a product, then hand each customer a subscription with its own key and its own limits.
- A developer portalA ready-made site where developers read the API reference and try calls. They can request a key there too. You can restyle it or host your own copy.
- Runs where your APIs runThe self-hosted gateway is a container. Run it in a datacenter, in another cloud or on Kubernetes, and manage it from one Azure instance.
- AI gateway policiesLimit tokens per caller, cache similar prompts, balance across several model deployments and govern MCP servers in front of Azure OpenAI and other model back ends.
- Checks before the back endValidate JWTs, ask for client certificates, filter by IP address or check the shape of a request before anything reaches your code.
- Revisions and versionsTry a change as a revision without touching live traffic, and publish breaking changes as a new version beside the old one.
Basic concepts
- API and operation
- An API is a set of operations, each one a method and path such as GET /orders/{id}. You add them by hand or import an OpenAPI file.
- Gateway
- The part that receives calls and runs your policies before forwarding to the back end. Azure manages it, or you can self-host it as a container.
- Management plane
- The portal, ARM and REST API where you configure everything. It is separate from the gateway that handles calls.
- Developer portal
- The website for people who build against your APIs. It is generated from your API definitions.
- Product
- A bundle of APIs offered to developers, with its own terms: a rate limit, a quota, and whether approval is needed.
- Subscription
- A pair of keys that identifies a caller for a product, API or the whole service. Sent in the Ocp-Apim-Subscription-Key header.
- Policy
- An XML statement that changes what happens to a call. Policies run in order and can be set for the whole service, a product, an API or one operation.
- Policy fragment
- A reusable block of policy XML that many APIs can include, so a rule like token validation is written once.
- Named value
- A stored setting or secret used in policies. It can point to a secret in Azure Key Vault instead of holding it.
- Backend
- A saved definition of where requests go, with its own credentials, circuit breaker and, for pools, load balancing.
- Revision
- A non-breaking change you can test next to the live one, then make current.
- Version
- A separate public edition of an API for breaking changes. Callers pick it by path, header or query string.
- Workspace
- A slice of one instance that a team manages on its own, with APIs, products and policies that belong only to it.
- Self-hosted gateway
- A Docker container that runs the gateway in your own network and reports back to the Azure instance.
How to create & configure it
Create an instance and publish your first API in the Azure portal
- Choose the tier before anything elsePick Developer to learn the full feature set (not for production), Consumption for a quick, low-cost trial that lacks some features, or a v2 tier for a real service. Changing later is possible but not always painless.
- Create the instanceSearch for API Management services, press Create, give it a globally unique name, a Region, your organisation name and an admin e-mail. Consumption and v2 instances usually appear within minutes. Classic tiers can take half an hour or more.
- Import an APIUnder APIs choose OpenAPI and paste the definition’s address, or start from an Azure Function, App Service or Logic App. Check the back-end URL it filled in.
- Test in the portalOpen the Test tab for an operation and send a call. If you get a response, the gateway can reach the back end.
- Package it as a productCreate a product, add the API, keep Requires subscription on, and publish it. Then create a subscription for a test user and copy a key.
- Call it with the keySend the request to the gateway URL with the Ocp-Apim-Subscription-Key header. A 401 means the key or the product link is wrong.
- Add your first policiesIn the policy editor of the API add a JWT check, a rate limit and a CORS rule. Keep the
line in each section so rules set at wider scopes still apply. - Turn on loggingConnect Application Insights and decide what to sample. Full request and response logging is rarely worth the cost.
- Go public properlyAdd a custom domain with a certificate, publish the developer portal, and put the instance behind your network rules before real traffic arrives.
Tip: once it works by hand, keep the instance, APIs and policies in Bicep, Terraform or an APIOps pipeline (see the code references). Portal edits that nobody wrote down are the usual reason a copy of the service behaves differently.
Common issues after configuration
| Symptom | Likely cause | What to check / fix |
|---|---|---|
| 401 Access denied due to missing subscription key | No key sent, or the API isn’t in a product that needs one | Send Ocp-Apim-Subscription-Key, check the subscription’s scope, and confirm the API belongs to the product. |
| 401 Unauthorized from validate-jwt | Token expired, wrong audience or wrong issuer | Decode the token and compare aud, iss and the expiry with the policy. Check the OpenID configuration URL is reachable from the gateway. |
| 404 Resource not found | Wrong base URL, API URL suffix or missing operation | Compare the call with the API’s URL suffix and the operation’s template. An operation that isn’t defined returns 404 even if the back end has it. |
| 429 Too Many Requests | A rate-limit or quota policy fired | Check which policy and which key it counts by. Return Retry-After and have clients back off. |
| 500 with a policy expression error | A C# expression failed at run time | Open the trace in the portal’s Test tab or Application Insights, and guard against nulls in expressions. |
| 502 Bad Gateway or 504 Gateway Timeout | The back end is slow, down or blocked | Call the back end directly, then check forward-request timeouts, firewall rules and, in a VNet, NSGs and DNS. |
| Backend connection failure inside a VNet | Missing route, DNS or NSG rule | Test name resolution and the port from the subnet. Check that required service endpoints or private DNS zones exist. |
| A policy change has no effect | Wrong scope, wrong order or | Policies are combined from several scopes. Look at the effective policy, and keep |
| Browser test console fails with CORS | No cors policy for that origin | Add a cors policy as the first rule in inbound, with the portal or site origin listed. |
| Developer portal still shows the old content | It hasn’t been published | Edits to the portal are drafts. Publish it from the portal designer, and clear the browser cache. |
| Named value from Key Vault shows an error | The instance’s identity can’t read the secret | Give the instance’s managed identity the secret-reading role on the vault and check the vault’s firewall. |
| Self-hosted gateway stops connecting | Access token expired or the endpoint is blocked | Generate a new gateway token, update the container’s configuration and allow outbound access to the management endpoint. |
Use cases: when and where to use it
Good fit
- Exposing internal services to partners with keys and quotas, plus documentation they can read
- Putting one set of security rules in front of APIs built by different teams
- Governing calls to Azure OpenAI and other model back ends (token limits, logging, failover)
- Modernising old SOAP or on-premises services behind a clean REST face
- Selling or sharing APIs as products with different plans
- Hybrid setups where some back ends can’t leave a datacenter
Consider something else
- A single app that only needs a public HTTPS address → the app’s own endpoint or Azure Front Door
- Simple pass-through for a few Functions → built-in Function URLs, or Azure Functions with Easy Auth
- Layer 7 load balancing and web application firewall in front of web apps → Azure Application Gateway or Front Door
- A lighter, cheaper gateway on AWS → Amazon API Gateway
- A full programme with analytics and monetisation on Google Cloud → Apigee
Pros: why consider it?
Why teams choose it
- Policies cover most needs, with no code to write
- A real developer portal and a product model are included
- Runs in your own datacenter or another cloud through the self-hosted gateway
- Works well with Entra ID and Key Vault, and Application Insights is a click away
- Revisions let you try changes safely
- New AI gateway policies for token limits and caching
Trade-offs to weigh
- The tier you pick shapes the bill, the networking and the feature list, and a wrong pick is expensive to undo
- Classic tiers take a long time to create and update
- XML policies and C# expressions are awkward to test
- Premium and the v2 tiers bill by the hour, whether anyone calls or not
- Some features differ by tier in ways that are easy to miss
- Moving away means rewriting policies
Common threats, vulnerabilities & risks
| Risk | Severity | Why it matters | Mitigation |
|---|---|---|---|
| Relying on subscription keys alone | High | Keys end up in app code and URLs, and one leaked key works until someone rotates it. | Add validate-jwt or client certificates, and rotate keys on a schedule. |
| Back end reachable without going through APIM | High | Callers who find the real address skip every policy you wrote. | Restrict the back end to the gateway’s IP, a private endpoint or a managed identity check. |
| Policy mistakes at wide scope | High | A rule set globally can break every API in the instance at once. | Review policy changes in code, test in a non-production instance and use policy fragments. |
| Secrets stored as plain named values | Medium | Anyone who can read the configuration sees the secret. | Use Key Vault named values and a managed identity. |
| Overly open CORS | Medium | A wildcard origin lets any site call the API from a visitor’s browser. | List the exact origins, methods and headers. |
| No rate limits | Medium | A bug or abusive client can overload the back end or run up a model bill. | Add rate-limit-by-key, quota-by-key and, for models, llm-token-limit. |
| Exposed developer portal or test console | Medium | A public portal tells attackers what exists and, with open sign-up, who may get keys. | Require sign-in, approval for products, and review what the portal publishes. |
| Verbose logging of bodies | Low–Med | Tokens and personal data land in logs. | Log headers and fields you choose, mask the rest and keep short retention. |
| Single instance, no resilience plan | Low–Med | An outage in one zone or Region takes every API with it. | Pick a tier with zone support, plan failover and test it. |
Performance optimisation
- Pick the tier for the load, then watch the capacity metric. Add units before it sits high, and scale back when it doesn’t.
- Cache with cache-lookup and cache-store for responses that rarely change. On Consumption you’ll need an external cache.
- Place the instance in the same Region as the busiest back ends, and use a gateway in each Region when callers are spread out.
- Keep policy expressions short. A send-request to another service inside a policy adds its latency to every call.
- Don’t buffer large bodies unless a policy needs them. Streaming is cheaper than copying.
- Set sensible timeouts and use retry only for calls that are safe to repeat.
- Use backend pools and circuit breakers so a failing back end is skipped quickly.
- Sample telemetry. Logging every call to Application Insights slows nothing much, but it costs a lot.
Reduce monthly cost
FinOps is the habit of managing cloud spend together with engineering. These are the FinOps checks that matter most for Azure API Management.
- Choose the tier honestly. Developer for non-production, Consumption for low or spiky traffic, a v2 tier for most production services, Premium only for what needs it.
- Don’t copy production’s tier into test and development; that’s how a spare Premium unit ends up costing thousands a year.
- Watch the capacity metric and use autoscale where your tier supports it, so you aren’t paying for idle units.
- On the classic and v2 tiers, billing runs by the hour while the instance exists. Delete spare instances and rebuild them from code when needed.
- Share one instance between teams with workspaces. Several half-empty instances cost more than one busy one.
- Cache responses that don’t change, and keep expensive back-end calls off the hot path.
- Log to Log Analytics with care. Ingestion charges can pass the gateway’s own cost, so sample and set retention.
- Count the extras too: a Redis cache, Key Vault operations, Defender for APIs, Front Door, and data transfer out.
- For model back ends, set token limits per caller, or one team’s experiment becomes everyone’s invoice.
- Tag instances by owner and product, and set a budget alert on the resource group.
Prices in this guide are examples from the public pricing page and differ by Region, tier and over time. Confirm the current numbers before you decide (see Pricing).
Security optimisation
- Don’t treat subscription keys as authentication. Validate JWTs from Entra ID (or another provider) with validate-jwt.
- Require client certificates for partner calls that need them.
- Make the back end accept calls only from the gateway: private endpoint, IP restriction, or a managed identity check.
- Keep secrets in Key Vault named values and give the instance a managed identity.
- Restrict CORS origins, and set ip-filter for known callers.
- Use a virtual network and, where your tier allows, a private endpoint, so the gateway isn’t open to the internet unless it has to be.
- Turn on Defender for APIs to spot unusual use and unprotected endpoints.
- Validate request content and size with validate-content before it reaches the back end.
- Protect the developer portal: sign-in, approval for products and a review of what it shows.
- Send diagnostics to a Log Analytics workspace, use Azure Policy for guardrails, and rotate keys.
Governance & compliance
Guardrails
- Required tags: Owner, Environment, CostCenter (Azure Policy)
- Azure Policy that requires a private network and diagnostic settings, and limits which tiers may be used
- Management locks on production instances
- Shared policy fragments for authentication and error handling
Continuous checks (Azure Policy and Defender)
- Diagnostic settings sent to Log Analytics
- Instances not open to the public network where policy requires it
- Minimum TLS version and protocols (disable old ones)
- Subscriptions with all-APIs scope flagged for review
- Defender for APIs recommendations
Use the Activity log to see who changed an instance, Azure Policy to enforce settings and Microsoft Defender for Cloud for recommendations. Microsoft publishes compliance reports in the Service Trust Portal. As always, responsibility is shared: Microsoft runs the platform, and you own the policies, keys, data and access.
Reduce carbon footprint
- Right-size the tier and units, and delete instances that no longer serve traffic.
- Cache, so repeated calls never reach the back end.
- Reject abuse early with rate limits and IP filters so it doesn’t use compute downstream.
- Choose Regions close to users and, where rules allow, ones with a lower-carbon grid.
- Log what you will actually read, and keep retention short.
- Share an instance through workspaces rather than giving every team its own.
- The Emissions Impact Dashboard and the Azure carbon optimization tools estimate emissions. Check what they cover for API Management.
Pricing
Purchase options
Consumption Per call
You pay per call, with a monthly free allowance of calls. It starts fast and costs little when quiet, but lacks features such as a built-in cache and network injection.
Developer Non-production
The classic tier with most features at a low hourly price. It carries no service-level agreement, so use it for building and learning.
Basic, Standard, Premium Per unit-hour
The classic production tiers, billed by the hour for each unit. Premium adds multi-region deployment, availability zones and virtual network injection.
Basic v2, Standard v2, Premium v2 Per unit-hour
Newer tiers that deploy faster and scale up to more units. Premium v2 adds the highest limits and network options. Features differ from the classic tiers, so compare them.
What you actually pay for
- Unit-hours for each gateway unit in Developer, Basic, Standard, Premium and the v2 tiers
- Calls above the free allowance on Consumption
- Extra units and extra regions on Premium
- Outbound data transfer
- Related services: Application Insights, Log Analytics, an external Redis cache, Key Vault, Front Door, Private Link and Defender for APIs
As a rough guide, recent list prices ran from a few dollars per million calls on Consumption to around $700 a month for one Standard v2 unit and close to $2,800 a month for Premium. Treat those as examples. Use the official Azure API Management pricing page and the Azure pricing calculator for current figures.
Important code references
Create a Developer-tier instance, import an API from its OpenAPI file, wrap it in a product and attach a policy that checks a JWT, limits each subscription and sets CORS. The Azure CLI and Terraform tabs build it, the XML tab shows the policy on its own, and the C# tab is a caller that sends the key and token and backs off when it is limited. Replace the placeholder names, addresses and tenant details with your own.
# Developer has every feature but no service-level agreement, so it is for learning and testing. It can take 30 to 40 minutes to create.
# For production pick a v2 tier or another tier from the pricing page
RG=rg-orders-api
LOCATION=centralindia
APIM=apim-orders-$RANDOM # the name becomes https://<name>.azure-api.net, so it must be unique
az group create --name $RG --location $LOCATION
az apim create --name $APIM --resource-group $RG --location $LOCATION \
--publisher-name "Example Ltd" --publisher-email api@example.com \
--sku-name Developer
# Import the API from its OpenAPI definition and point it at the back end
az apim api import --resource-group $RG --service-name $APIM \
--api-id orders --path orders --display-name "Orders API" \
--specification-format OpenApi --specification-url https://orders.example.com/openapi.json \
--service-url https://orders.example.com
# A product that needs a subscription key and no manual approval, with the API added to it
az apim product create --resource-group $RG --service-name $APIM \
--product-id starter --product-name "Starter" --description "Low-volume access for new partners" \
--subscription-required true --approval-required false --state published
az apim product api add --resource-group $RG --service-name $APIM --product-id starter --api-id orders
# A subscription for a test caller (the CLI has no command for this, so use the management REST API)
SUB_ID=$(az account show --query id --output tsv)
BASE="https://management.azure.com/subscriptions/$SUB_ID/resourceGroups/$RG/providers/Microsoft.ApiManagement/service/$APIM"
az rest --method put --url "$BASE/subscriptions/test-caller?api-version=2022-08-01" \
--body "{\"properties\":{\"scope\":\"/products/starter\",\"displayName\":\"Test caller\"}}"
# Read the key and make a call
KEY=$(az rest --method post --url "$BASE/subscriptions/test-caller/listSecrets?api-version=2022-08-01" --query primaryKey --output tsv)
curl -i -H "Ocp-Apim-Subscription-Key: $KEY" https://$APIM.azure-api.net/orders/orders
# Developer_1 is for learning and testing (no service-level agreement, and slow to create); pick a v2 or classic tier for production
resource "azurerm_resource_group" "api" {
name = "rg-orders-api"
location = "centralindia"
}
resource "azurerm_api_management" "orders" {
name = "apim-orders-example" # must be globally unique
location = azurerm_resource_group.api.location
resource_group_name = azurerm_resource_group.api.name
publisher_name = "Example Ltd"
publisher_email = "api@example.com"
sku_name = "Developer_1"
identity {
type = "SystemAssigned"
}
tags = {
Env = "dev"
Owner = "platform-team"
}
}
resource "azurerm_api_management_api" "orders" {
name = "orders"
resource_group_name = azurerm_resource_group.api.name
api_management_name = azurerm_api_management.orders.name
revision = "1"
display_name = "Orders API"
path = "orders"
protocols = ["https"]
service_url = "https://orders.example.com"
subscription_required = true
import {
content_format = "openapi-link"
content_value = "https://orders.example.com/openapi.json"
}
}
resource "azurerm_api_management_product" "starter" {
product_id = "starter"
api_management_name = azurerm_api_management.orders.name
resource_group_name = azurerm_resource_group.api.name
display_name = "Starter"
subscription_required = true
approval_required = false
published = true
}
resource "azurerm_api_management_product_api" "starter_orders" {
api_name = azurerm_api_management_api.orders.name
product_id = azurerm_api_management_product.starter.product_id
api_management_name = azurerm_api_management.orders.name
resource_group_name = azurerm_resource_group.api.name
}
# The policy lives in its own file so it can be reviewed and tested like any other code
resource "azurerm_api_management_api_policy" "orders" {
api_name = azurerm_api_management_api.orders.name
api_management_name = azurerm_api_management.orders.name
resource_group_name = azurerm_resource_group.api.name
xml_content = file("${path.module}/orders-policy.xml")
}
output "gateway_url" {
value = azurerm_api_management.orders.gateway_url
}
<!-- orders-policy.xml: applies to every operation of the Orders API -->
<policies>
<inbound>
<base />
<!-- Browsers may call this API only from our own site -->
<cors allow-credentials="false">
<allowed-origins>
<origin>https://app.example.com</origin>
</allowed-origins>
<allowed-methods>
<method>GET</method>
<method>POST</method>
</allowed-methods>
<allowed-headers>
<header>authorization</header>
<header>content-type</header>
<header>ocp-apim-subscription-key</header>
</allowed-headers>
</cors>
<!-- Only callers with a valid token from our Entra ID tenant -->
<validate-jwt header-name="Authorization" failed-validation-httpcode="401" failed-validation-error-message="Unauthorized">
<openid-config url="https://login.microsoftonline.com/YOUR-TENANT-ID/v2.0/.well-known/openid-configuration" />
<audiences>
<audience>api://orders-api</audience>
</audiences>
</validate-jwt>
<!-- 100 calls a minute for each subscription; the header tells the caller how many are left -->
<rate-limit-by-key calls="100" renewal-period="60" counter-key="@(context.Subscription.Id)" remaining-calls-header-name="X-Calls-Remaining" />
<set-header name="X-Request-Id" exists-action="skip">
<value>@(context.RequestId.ToString())</value>
</set-header>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
<!-- Don't tell callers which server software answered -->
<set-header name="X-Powered-By" exists-action="delete" />
<set-header name="Server" exists-action="delete" />
</outbound>
<on-error>
<base />
</on-error>
</policies>
// Program.cs: a caller that sends the subscription key and a token, and backs off politely when the gateway says 429
using System.Net;
using System.Net.Http.Headers;
var baseAddress = new Uri("https://apim-orders-example.azure-api.net/");
var subscriptionKey = Environment.GetEnvironmentVariable("APIM_KEY")!;
var token = Environment.GetEnvironmentVariable("ACCESS_TOKEN")!; // from Entra ID, for example with Azure.Identity
using var client = new HttpClient { BaseAddress = baseAddress, Timeout = TimeSpan.FromSeconds(30) };
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", subscriptionKey);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
for (var attempt = 1; attempt <= 4; attempt++)
{
using var response = await client.GetAsync("orders/orders?limit=20");
if (response.IsSuccessStatusCode)
{
Console.WriteLine(await response.Content.ReadAsStringAsync());
break;
}
if (response.StatusCode == HttpStatusCode.TooManyRequests && attempt < 4)
{
// Honour Retry-After when the policy sends it, otherwise wait a little longer each time
var wait = response.Headers.RetryAfter?.Delta ?? TimeSpan.FromSeconds(2 * attempt);
Console.WriteLine($"Limited. Waiting {wait.TotalSeconds:0} s before attempt {attempt + 1}.");
await Task.Delay(wait);
continue;
}
Console.WriteLine($"Failed with {(int)response.StatusCode}: {await response.Content.ReadAsStringAsync()}");
break;
}
Best videos to explore
Short walkthrough videos for this service are being prepared. They will appear here and load only when you press play. Until then, follow CloudBrum on YouTube for new videos.
Interview questions
BasicWhat is Azure API Management?
It is a managed service that puts a gateway, a rule engine and a developer portal in front of your APIs. Callers use one address, APIM checks their key or token, applies the policies you set, and forwards the call to your back end in Azure, on premises or another cloud.
BasicWhat are products and subscriptions?
A product is a bundle of APIs offered to developers with its own terms, such as a rate limit, a quota and whether approval is needed. A subscription gives a developer or an app a pair of keys for a product, which they send in the Ocp-Apim-Subscription-Key header so APIM can tell callers apart and meter them.
BasicWhat is a policy?
A policy is an XML statement that changes what happens to a call: check a token, limit the rate, rewrite a URL, set a header, cache a response. Policies run at four steps (inbound, backend, outbound and on-error) and can be set for the whole service, a product, an API or a single operation.
IntermediateHow do you secure an API behind APIM?
Don’t rely on subscription keys alone, because they only identify a caller. Validate a JWT from Entra ID with validate-jwt, require client certificates where needed, and filter by IP if the callers are known. Then make sure the back end only accepts traffic from the gateway, through a private endpoint, an IP rule or a managed identity. Add Defender for APIs and rate limits to catch misuse.
IntermediateWhat is the difference between a revision and a version?
A revision is a non-breaking change that you can test beside the live API and then make current, and callers don’t notice it. A version is a separate public edition for breaking changes, chosen by path, header or query string, so old clients keep working on the old version while new ones move to the new.
IntermediateHow do you choose a tier?
Start from need, not price. Consumption suits low or spiky traffic and quick trials. Developer is for non-production. For most production services look at the v2 tiers first, and keep classic Premium for things only it offers, such as multi-region deployment. Check the tier comparison for network options, cache, self-hosted gateway and SLA before you commit, because they differ.
AdvancedHow would you expose APIs that run on premises or in another cloud?
Use the self-hosted gateway. It is a container that you run in your own datacenter or Kubernetes cluster, close to the back ends, and it takes its configuration from the Azure instance. Calls stay local, and you manage all APIs from one place. You need the right tier, outbound connectivity to the management endpoint and a plan for keeping the gateway version current.
AdvancedHow do you run APIM across many teams without chaos?
Give each team a workspace so they manage their own APIs, products and policies, and keep shared rules in policy fragments owned by a platform team. Put the whole configuration in Bicep, Terraform or an APIOps pipeline with review and a non-production instance, so portal edits don’t drift. Use Azure Policy for guardrails and separate subscriptions for production and test.
AdvancedHow would you protect an Azure OpenAI back end with APIM?
Authenticate the gateway to the model with a managed identity so no keys are shared. Use llm-token-limit to cap tokens per caller or per team, emit token metrics to see who spends what, and add content safety checks. Define a backend pool of deployments with a circuit breaker so a throttled or failing deployment is skipped, and consider semantic caching (it needs a compatible Redis cache) for repeated prompts.
AdvancedHow do you design for high availability?
Pick a tier with availability zone support and spread units across the zones, with at least two units. For regional failure, classic Premium can add gateways in other Regions, and Front Door or Traffic Manager can send callers to a healthy one. Remember that the back ends need the same resilience, that the cache and logs are per Region, and that the SLA you get depends on the tier and the way you configure it.
Similar or alternative services on other clouds
| Capability | AWS | Azure | Google Cloud |
|---|---|---|---|
| Service | Amazon API Gateway | Azure API Management | Apigee and Google Cloud API Gateway |
| Strength | Low-cost HTTP APIs that sit in front of Lambda | A rich policy engine with products and a portal | Apigee: managing many APIs and partners. API Gateway: a light front for serverless code |
| Where behaviour is defined | Route settings, authorizers and REST mapping templates | XML policies on the inbound, backend, outbound and error steps | Apigee: XML in a proxy bundle. API Gateway: an OpenAPI document |
| Identity of the caller | IAM, Cognito, JWT, Lambda authorizers and keys | Subscription keys, validate-jwt, OAuth 2.0, certificates | Apigee: API keys and OAuth tokens. API Gateway: keys, JWT, service accounts |
| Throttling | Throttles on the account and stage, usage plans for REST | rate-limit-by-key and quota-by-key | Apigee: SpikeArrest and Quota policies |
| Portal for developers | Managed portals for REST APIs | Built in, restyle or self-host | Apigee: integrated or Drupal-based. API Gateway: none |
| Run it yourself | Not offered; private APIs reach VPCs | Self-hosted gateway in a datacenter, another cloud or Kubernetes | Apigee hybrid on your own Kubernetes |
| Price model | Calls, plus the cache by the hour | Hours per unit, or calls on Consumption | Apigee: subscription or usage. API Gateway: calls |
Not sure a full gateway is the right size? Azure Functions can serve HTTP on its own, Azure Front Door and Application Gateway handle web traffic and WAF, and Azure Container Apps can expose an app directly.
Did you find this article helpful?
Your answer helps us improve this page for the next reader.
Sources and further reading
CloudBrum wrote this page in its own words, using the provider’s public documentation listed below as the reference. Features, limits, names and prices change, so confirm anything that matters on the provider’s own pages before you decide.
- What is Azure API Management? (key concepts)Microsoft
- Feature-based comparison of the API Management tiersMicrosoft
- v2 service tiers overviewMicrosoft
- API Management pricingMicrosoft
- API Management policy referenceMicrosoft
- Reliability and availability in API ManagementMicrosoft
- Availability zone support in API ManagementMicrosoft
- AI gateway capabilities in API ManagementMicrosoft
- Self-hosted gateway overviewMicrosoft
- Terraform AzureRM provider: azurerm_api_managementHashiCorp
