---
title: Azure Platform & Topology Overview
summary: Reference architecture for BookWorm's subscription-scoped Azure deployment, shared platform services, and network ingress boundaries.
owners:
  - platform-engineering-team
badges:
  - content: Platform Reference
    backgroundColor: blue
    textColor: blue
---

BookWorm runs on an Azure Container Apps environment provisioned per resource group across `Development`, `Staging`, and `Production` environments. The platform boundary encompasses public ingress routing via a YARP API Gateway, shared container registry and telemetry infrastructure, and identity-based integration with managed data, AI, and external messaging services.

## Platform Topology and Ingress Boundaries

<MermaidFileLoader file="mermaids/001-platform-overview-diagram-1.mmd" />

## Component & Responsibility

| Component                        | Role                                                                                       | Protocol / Interface             | Persistence / State                                                        | Notes                                                         |
| :------------------------------- | :----------------------------------------------------------------------------------------- | :------------------------------- | :------------------------------------------------------------------------- | :------------------------------------------------------------ |
| **Container Apps Environment**   | Managed `Consumption` runtime hosting all 16 application workloads and operational tooling | Internal & external HTTP/gRPC    | Stateless orchestration                                                    | Resource group-isolated                                       |
| **API Gateway**                  | Sole public entry point for customer/staff frontends and capability APIs                   | External HTTPS (port `5000`)     | Stateless                                                                  | YARP reverse proxy; proxies identity routes and enforces CORS |
| **Quartz Dashboard**             | Administrative UI for scheduled job inspection and manual triggering                       | External HTTPS (port `8080`)     | Reads [[container\|scheduler-database]] via [[service\|scheduler-service]] | Protected by [[service\|oauth-api]] OIDC (`admin` role)       |
| **Azure Container Registry**     | Stores .NET and Next.js container images                                                   | HTTPS (registry pull)            | Container image artifacts                                                  | `Basic` SKU; pulled via shared environment identity           |
| **Environment Managed Identity** | Shared user-assigned identity for registry image pulls                                     | Azure RBAC (`AcrPull`)           | Stateless identity                                                         | Bound to Container Apps Environment                           |
| **Log Analytics Workspace**      | Centralized platform and application telemetry sink                                        | OTLP / Azure Monitor             | 30 days (Dev/Staging); 90 days (Prod)                                      | Shared across all hosted workloads                            |
| **Aspire Dashboard**             | Live OpenTelemetry logs, distributed traces, and metrics console                           | Managed Container Apps component | Ephemeral live stream                                                      | Provisioned per environment                                   |

## Configuration & Operational Defaults

### Network & Ingress Boundary

- **Public gateway entry:** External HTTPS traffic enters through the API Gateway.
- **Internal service addressing:** All internal apps communicate over environment-internal HTTPS without public exposure.
- **CORS policy:** Every routed backend API permits `GET`, `POST`, `PUT`, `PATCH`, and `DELETE` with credentials from the gateway browser origin.
- **Internal-only workloads:** Frontends (Storefront, Commerce, Backoffice), capability APIs (Catalog, Basket, Ordering, Rating, Chat), MCP Tools (accepts gateway origin CORS), background workers (Catalog Ingestion, Finance, Notification, Scheduler), and privacy sidecars (Presidio Analyzer and Anonymizer on HTTP port `3000`) have no public ingress.

### API Gateway Route Map

Backend routes match in registration order; the Storefront catch-all route carries the lowest routing priority.

| Route pattern                                                | Destination              | Routing behavior                                                |
| :----------------------------------------------------------- | :----------------------- | :-------------------------------------------------------------- |
| `/chatting/{**remainder}`                                    | [[service\|chat-api]]    | Strips `/chatting` prefix; preserves host and forwarded headers |
| `/rating/{**remainder}`                                      | [[service\|rating-api]]  | Strips `/rating` prefix; preserves host and forwarded headers   |
| `/ordering/{**remainder}`                                    | [[service\|order-api]]   | Strips `/ordering` prefix; preserves host and forwarded headers |
| `/basket/{**remainder}`                                      | [[service\|basket-api]]  | Strips `/basket` prefix; preserves host and forwarded headers   |
| `/catalog/{**remainder}`                                     | [[service\|catalog-api]] | Strips `/catalog` prefix; preserves host and forwarded headers  |
| `/entra/{**remainder}`                                       | [[service\|oauth-api]]   | Strips `/entra` prefix; forwards to external identity provider  |
| `/backoffice/{**remainder}`                                  | Backoffice               | Routes staff administration microfrontend                       |
| `/basket`, `/checkout/*`, `/account/*`, `/commerce-assets/*` | Commerce                 | Routes customer checkout and account microfrontend              |
| `/{**remainder}`                                             | Storefront               | Catch-all storefront microfrontend (lowest priority)            |

<AccordionGroup>
	<Accordion title="Deployment Targeting & External Parameters">
		Resource names use deterministic per-resource-group tokens. Deploy each environment (`Development`, `Staging`, `Production`) to a dedicated resource group to keep resource names isolated.

    	| Parameter | Purpose | Default / notes |
    	| :-------- | :------ | :-------------- |
    	| **Subscription & Tenant** | Target Azure subscription and Microsoft Entra ID tenant | Required |
    	| **Region & Resource Group** | Target Azure region and environment resource group | Defaults to `southeastasia` in CI/CD |
    	| **Kafka Broker Connection** | External Kafka cluster connection | Required in Azure deployments |
    	| **Vector Database Connection** | External Qdrant Cloud connection | Required in Azure deployments |
    	| **SMTP Endpoint & Port** | External email relay endpoint | Defaults to SendGrid on port `587` |
    	| **SMTP Credentials & Sender** | Relay username, password, sender address, and display name | Password and sender address required |
    </Accordion>
    <Accordion title="Local Run Mode vs. Azure Publish Mode">
    	| Concern | Local Run Mode | Azure Publish Mode |
    	| :------ | :------------- | :----------------- |
    	| **Data stores** | Local containers and emulators (PostgreSQL, Redis, Cosmos DB, Azurite, Durable Task Scheduler) | Azure-managed services |
    	| **Kafka and Qdrant** | Local containers with Kafka UI | External managed providers |
    	| **Email** | Mailpit container (SMTP port `587`) | SendGrid SMTP relay |
    	| **Developer tooling** | Scalar API explorer and MCP inspector | Not provisioned |
    	| **Entra Agent Identities** | Not provisioned | Provisioned via Microsoft Graph |
    </Accordion>

</AccordionGroup>

## Guardrails & Constraints

<Admonition type="warning" title="Restrict Quartz Dashboard Ingress Before Production">
	Quartz Dashboard is the second externally reachable workload alongside the API Gateway. Restrict
	its public network ingress before serving Production traffic; see
	[[doc|operational/004-security-hardening-checklist]].
</Admonition>

<Admonition type="info" title="Commerce /basket Route Precedence">
	The exact Commerce path `/basket` overlaps with the backend `/basket/{**remainder}` API prefix. Exact microfrontend routes take precedence so the Commerce page serves bare `/basket` requests while `/basket/...` API calls still route to [[service|basket-api]].
</Admonition>

## Related Documentation

- [[doc|platform/002-compute-and-container-apps]] — Inventory of all 16 application Container Apps and Quartz Dashboard.
- [[doc|platform/003-data-ai-and-messaging-resources]] — Environment-tier SKUs and datastore ownership.
- [[doc|platform/004-identity-and-rbac-matrix]] — Entra ID applications, scopes, Agent Identities, and Managed Identity roles.
- [[doc|operational/001-azure-deployment-guide]] — Provisioning procedure.

<NodeGraph id="BookWorm" version="1.0.0" type="domain" mode="simple" maxHeight="30" />

<ArchitectureGraph lens="services" lensPicker={true} maxHeight="35" />
