AI, LLM and real-time · Azure

LLM inference on Azure with Azure OpenAI, an APIM AI gateway and AI Search

A governed Azure OpenAI platform: Front Door and API Management as the AI gateway, private endpoints, Entra ID managed identities, AI Search for retrieval, Content Safety, Cosmos DB for conversation state and Monitor for cost and quality.

A reference architecture from EITSAA, not a named client system. Service limits, prices and product features change, so confirm current details before you commit to a design.

  • Australian Privacy Principles (APP 11)
  • ACSC Essential Eight
  • Australia East (primary) and Australia Southeast

Architecture

Architecture diagram. Tinted boundaries show regions, accounts, networks and trust zones. Numbered arrows match the flow below.
LLM inference on Azure with Azure OpenAI, an APIM AI gateway and AI Search architectureStaff and apps to Azure Front Door: HTTPS. Azure Front Door to API Management: Private Link. API Management to Orchestrator: validated JWT. Orchestrator to Azure AI Search: retrieve. Orchestrator to Azure AI Content Safety: screen. Orchestrator to Azure OpenAI: managed identity. Orchestrator to Cosmos DB: state. API Management to Application Insights: token metricsUsers and appsAzure subscription · Australia EastVirtual network · private endpointsStaff and appsEntra ID tokensAzure Front DoorWAF, TLSAPI ManagementAI gateway policiesOrchestratorContainer Apps, RAG logicAzure OpenAIDeployments, private endpointAzure AI SearchHybrid and semantic rankerCosmos DBChat history, stateAzure AI ContentSafetyPrompt Shields, filtersApplication InsightsTraces, tokens, cost1HTTPS2Private Link3validated JWT4retrieve5screen6managed identity7state8token metricsPlatform servicesMicrosoft EntraIDAzure MonitorAzure Key VaultDefender forCloud
  • People and clients
  • Network and edge
  • Messaging, events and workflow
  • AI and ML
  • Databases and data
  • Security and identity
  • Monitoring, audit and analytics
  • Request or data flow
  • Asynchronous or optional
  • Boundary: region, account, network or trust zone

Request and data flow

  1. Users and apps reach Azure Front Door with WAF. Premium tier lets Front Door use Private Link to the origin.

  2. API Management is the AI gateway. It validates the Entra ID token, applies per-product token quotas and rate limits, and can load balance across multiple model deployments or regions with circuit breaking.

  3. The orchestrator receives the validated request with the caller's identity and groups.

  4. It queries Azure AI Search with a hybrid (keyword and vector) query plus semantic ranking, applying security trimming filters from the caller's groups.

  5. Prompts and retrieved content are checked by Azure AI Content Safety, including Prompt Shields for injection, and outputs are screened for harmful content.

  6. The orchestrator calls the Azure OpenAI deployment using its managed identity over a private endpoint, with key-based authentication disabled.

  7. Conversation state and feedback go to Cosmos DB with a time-to-live that matches the retention policy.

  8. API Management emits token usage metrics and the gateway logs to Application Insights, which feed cost allocation by team and product.

Components and why they were chosen

ComponentWhat it doesWhy this choice
Azure Front Door Premium with WAFGlobal entry, WAF and Private Link origins.Keeps APIM and apps private.
Azure API Management (AI gateway)Token limits, semantic caching, backend pools and metrics for Azure OpenAI and other model APIs.A single control point for quotas, chargeback and resilience across model deployments.
Azure OpenAI in Foundry ModelsGPT family and embedding model deployments with regional, data-zone or global deployment types and provisioned throughput options.Choose deployment type by residency and performance needs. Check model availability in Australia East.
Azure AI SearchHybrid retrieval, semantic ranking and security trimming.Mature enterprise retrieval with built-in indexers and integrated vectorisation.
Azure AI Content SafetyHarm categories, Prompt Shields and groundedness detection.Policy enforcement independent of the model.
Azure Cosmos DBLow-latency conversation and session store.Global distribution is available and TTL gives retention control.
Container AppsOrchestrator and ingestion workers.Managed containers inside the VNet.
Microsoft Entra ID and managed identitiesUser and workload identity.No keys to rotate.
Key Vault, Monitor and Defender for CloudSecrets, telemetry and posture.Native governance.

Design decisions and trade-offs

Deployment type

Regional or data-zone deployments where residency matters, provisioned throughput for steady high volume, global standard for low-sensitivity workloads.

Why. Aligns data-processing location, latency and cost.

Trade-off. Regional capacity and model versions can lag, so confirm availability early.

AI gateway

API Management with token-limit and metrics policies in front of all model access.

Why. Cost control, chargeback and resilience.

Trade-off. Extra hop and APIM tier cost.

Authentication to the model

Managed identity, disable local key auth.

Why. Removes shared keys.

Trade-off. Local tools need developer RBAC roles.

Retrieval

AI Search with security trimming, not post-filtering in code.

Why. The model never sees content the user cannot access.

Trade-off. Group and ACL syncing in the index.

Responsible AI

Content Safety and evaluation in the pipeline.

Why. Measured, repeatable safety.

Trade-off. Added latency and cost per call.

Well-architected pillars

Security

Private endpoints, Entra ID, managed identities, Key Vault CMK, WAF, Prompt Shields and security-trimmed retrieval.

Reliability

Zone-redundant services, APIM backend pools across deployments with circuit breakers, and queued retries for batch work.

Performance

Provisioned throughput for predictable latency, semantic caching in APIM, streaming responses and right-sized chunking.

Cost optimisation

Tokens and provisioned units. APIM token metrics enable per-team budgets and alerts.

Operational excellence

Bicep or Terraform, GitHub Actions with federated credentials, evaluation gates and Azure Monitor workbooks.

Sustainability

Smaller models for routing and extraction, caching and scheduling batch work off peak.

Network, identity and data

Networking

Spoke VNet with private endpoints for Azure OpenAI, AI Search, Cosmos DB, Storage and Key Vault. Public network access disabled on those services. Private DNS zones for privatelink names. Egress via the hub firewall where required.

Identity and least privilege

Users sign in with Entra ID and Conditional Access. Application roles map to APIM products. The orchestrator uses a managed identity with Cognitive Services OpenAI User and Search Index Data Reader roles only. PIM for administrators.

Data and encryption

Azure OpenAI does not use your prompts or completions to train base models under the service terms, but confirm current terms and the data-processing location of your deployment type. Encrypt with customer-managed keys where required, set TTL on stored conversations, and redact personal information before logging.

Security and compliance mapping

ControlHow this design addresses it
Multi-factor authenticationConditional Access. Essential Eight.
Restrict administrative privilegesPIM and role-scoped managed identities. Essential Eight.
Responsible AIContent Safety, evaluation and human oversight align with the Voluntary AI Safety Standard.
PrivacyPrivate networking, retention and logging controls support APP 11.

Mappings show how the design supports each control. They are not certifications, and EITSAA does not claim IRAP assessment or compliance for any reference architecture.

Failure modes, targets and scaling

  • Target RTOUnder an hour for the platform. Zone loss is handled by zone-redundant services
  • Target RPOCosmos DB and Search per their backup and replication settings
  • Scaling and limitsTokens-per-minute and provisioned unit quotas per deployment and region. Request increases ahead of launch.
Failure modeMitigation
Model deployment throttled (429)APIM retries and load balancing across deployments, with fallback to another region if residency allows.
Prompt injection through a documentPrompt Shields, data isolation and no side-effect tools in this tier.
Index permissions staleFrequent ACL sync and a source kill switch.
Private DNS misconfigurationDNS in code and connectivity tests in the pipeline.

Observability and runbooks

  • APIM token metrics by product and team.
  • Application Insights traces with retrieval and model spans.
  • Evaluation runs for groundedness and safety on each release.

Cost drivers and levers

Tokens or provisioned throughput units, AI Search units, APIM tier and Front Door.

  • Use semantic caching.
  • Tier models by task.
  • Right-size Search replicas.
  • Reservations for provisioned throughput.

Implementation and fit

Phased approach

  1. Landing zone, private networking and one model deployment.
  2. APIM gateway with quotas and metrics.
  3. Retrieval, Content Safety and evaluation.
  4. Onboard teams as APIM products with budgets.

Anti-patterns to avoid

  • Shared API keys across teams.
  • Public network access on model and search resources.
  • No token quotas.
  • Filtering retrieved content after the model call.

When to use it

  • Microsoft-centric organisations needing governed model access.
  • Several teams sharing one model platform.

When not to

  • A single small app (call the model directly with managed identity).
  • Where residency demands exceed deployment type options.

More in ai, llm and real-time

Related insights

Discuss this architecture

Tell us your systems, constraints and timeline. We reply within one business day, and the initial conversation is free.