Azure Architecture Guide

CH09-02: API Gateway Responsibilities with API Management

Goal

The previous section described the API platform as a contract boundary. This section focuses on the gateway layer at that boundary and where Azure API Management fits.

An API gateway is not valuable because it sits in front of everything. It is valuable when it carries clear boundary responsibilities: consumer access, routing, policy enforcement, version exposure, documentation, telemetry, and operational visibility.

The durable idea is:

API Management sits at the contract boundary where consumer traffic, policies, routing, and visibility are controlled.

The Short Version

Azure API Management is a managed service for publishing, securing, transforming, monitoring, and managing APIs. It commonly acts as the gateway between consumers and backend services.

API Management can help with:

  • Publishing APIs through a consistent gateway endpoint.

  • Grouping APIs into products for different consumers.

  • Managing subscriptions and developer access.

  • Applying policies for authentication checks, rate limits, quotas, transformations, headers, routing, and caching patterns.

  • Routing requests to backend APIs.

  • Supporting API versions and revisions.

  • Collecting telemetry for API calls.

  • Providing a developer portal experience where appropriate.

The gateway is a boundary control point. It is not a replacement for reliable backend services, secure data access, good API design, or domain ownership.

Gateway Responsibilities

At a high level, the gateway path looks like this:

flowchart LR
    C["Consumers<br/><small>Apps, partners, internal tools</small>"]
    APIM["API Management<br/><small>Gateway and API lifecycle boundary</small>"]
    P["Policies<br/><small>Validate, transform, limit, route</small>"]
    T["Telemetry<br/><small>Usage, latency, failures</small>"]
    B["Backend APIs<br/><small>Business logic and data access</small>"]

    C --> APIM --> P --> B
    APIM --> T
    B --> T

This model helps separate responsibilities. API Management receives the consumer request, applies boundary controls, routes the request, and records useful signals. The backend service performs the business action and protects its own data and dependencies.

Core API Management Concepts

You do not need to memorize every API Management feature immediately. Start with the practical architecture concepts.

ConceptPlain-Language MeaningArchitecture Use
GatewayThe runtime endpoint consumers call.Centralizes API entry, routing, policies, and telemetry.
APIA published contract for a capability.Defines operations, paths, methods, and behavior consumers use.
OperationA specific callable action inside an API.Lets teams apply policy and documentation at a precise level.
ProductA bundle of APIs for a consumer group.Helps separate public, partner, internal, or premium access.
SubscriptionA way to give consumers controlled access to products or APIs.Supports onboarding, access tracking, and traffic controls.
PolicyA rule applied at the gateway.Handles cross-cutting behavior such as validation, transformation, limits, and routing.
Developer portalA place for API discovery and onboarding.Helps consumers learn, request access, and use APIs consistently.

The key pattern is that API Management makes the boundary explicit. Instead of every backend team inventing its own onboarding, policy, documentation, and telemetry pattern, the platform can provide shared controls.

What Policies Are Good For

API Management policies can be powerful, so it is important to use them with judgment.

Policies are good for boundary behavior such as:

  • Checking tokens or subscription keys.

  • Applying rate limits or quotas.

  • Validating request headers or basic message shape.

  • Rewriting URLs for backend routing.

  • Adding or removing headers.

  • Transforming simple request or response formats.

  • Caching selected responses when the API design allows it.

  • Routing requests to different backends by version, path, product, or policy.

  • Emitting useful telemetry.

Policies are not a good home for deep business rules. If a rule decides whether an order can be refunded, whether a customer can access a sensitive record, or whether inventory can be reserved, that rule belongs in the backend service or domain layer. The gateway can help enforce caller and contract rules, but the backend should still protect the business.

Gateway Placement Matters

API Management can be part of public, internal, or hybrid API designs. Placement affects networking, latency, availability, security, and operations.

Ask these questions early:

  • Are consumers public, internal, partner, or service-to-service callers?

  • Should the gateway expose public endpoints, private endpoints, or both?

  • Are backend services public, private, or inside virtual networks?

  • Does the API need regional or multi-region availability?

  • Which team owns gateway configuration and policy exceptions?

  • How will gateway logs connect to backend and dependency telemetry?

  • Which tier or deployment option matches expected traffic and availability needs?

A gateway in the wrong place can create awkward designs. For example, a public gateway with private backends needs a secure backend connectivity pattern. An internal-only API may not need the same exposure model as a partner API. A latency-sensitive API may need careful regional placement.

Example: Partner Order API

Imagine a retailer exposing an order status API to a fulfillment partner. The partner should only see approved operations, send limited traffic, and receive consistent error responses.

A first-pass gateway design might be:

Partner system
  -> API Management product: Partner Fulfillment APIs
  -> Subscription access and token validation
  -> Rate limit and quota policy
  -> Request validation and correlation ID
  -> Route to Order API backend
  -> Gateway and backend telemetry

The backend Order API still owns order rules. It decides whether an order exists, whether the partner may see it, what fulfillment state means, and how order data is stored. API Management controls the partner-facing boundary.

Common Mistakes

  • Putting too much business logic in gateway policies.

  • Assuming API Management automatically makes unreliable backends reliable.

  • Ignoring gateway capacity, networking, and monitoring.

  • Publishing APIs without clear products, owners, or consumer groups.

  • Treating the developer portal as documentation while the actual contract remains unclear.

  • Applying one policy to every API even when public, partner, and internal consumers have different risks.

If Someone Asks You

What is Azure API Management responsible for?

A good answer is:

Azure API Management is responsible for the API boundary. It publishes APIs through a managed gateway, applies policies, routes requests, supports products and subscriptions, helps with developer access, and provides telemetry. It centralizes cross-cutting controls, but backend services still own business behavior, data integrity, reliability, and domain-specific authorization.

What You Should Remember

Use the gateway for API boundary controls, not as a replacement for service ownership.

Questions to Check Your Understanding

  1. Which controls can API Management centralize?

  2. What should backend services still own?

  3. Why does gateway placement matter?

  4. Why should gateway policies avoid deep domain logic?