Skip to content

Deployment

Target

Azure definitions express intended placement. They do not establish live deployment, restore readiness or production acceptance.

Code and tests

The diagram shows the Azure deployment defined by Terraform for each staging or production environment. It includes the application paths, runtime services, managed data and external dependencies. It is a target topology, not evidence of a live deployment. Dashed paths mark services that are not in the Azure release inventory.

flowchart LR
  Browser["Users and operators"]
  Integrator["External legal clients"]

  subgraph Azure["Azure environment: staging or production"]
    Edge["Front Door + WAF<br/>HTTPS custom domains"]

    subgraph Public["Public Container Apps environment"]
      App["Next app<br/>app + admin hosts"]
      Site["Marketing site"]
      Docs["Developer portal<br/>and Starlight docs"]
    end

    subgraph Backend["Internal Container Apps environment"]
      ProductAPI["Product API<br/>workspace and authorization"]
      ProductWorker["Product worker<br/>DBOS + document jobs + model gateway"]
      Parser["Document parser<br/>bounded extraction"]
      LegalCore["Legal Core API<br/>retrieval and pinned reads"]
      CorpusWorker["Corpus worker<br/>DBOS ingestion and indexing"]
      ProductMigrator["Product migrator job"]
      LegalMigrator["Legal migrator job"]
    end

    subgraph Data["Private data plane: endpoints + private DNS"]
      ProductDB[("PostgreSQL: product database")]
      LegalDB[("PostgreSQL: legal database")]
      ProductBlob[("Blob: product")]
      CorpusBlob[("Blob: corpus")]
      DeletionBlob[("Blob: deletion journal")]
      Vault["Key Vault<br/>versioned secrets"]
      Registry["Container Registry<br/>digest-addressed images"]
    end

    Logs["Log Analytics + Azure Monitor"]
  end

  Clerk["Clerk identity"]
  Anthropic["Anthropic models"]
  Voyage["Voyage embeddings / reranking"]
  Email["Email provider"]
  PublicLegal["Public Legal API preview<br/>not in Azure release"]
  MCP["MCP adapter<br/>not implemented"]

  Browser -->|HTTPS| Edge
  Edge -->|app.kesita.ai / admin.kesita.ai| App
  Edge -->|kesita.ai| Site
  Edge -->|internal.kesita.ai| Docs
  App <-->|sessions| Clerk
  App -->|same-origin gateway| ProductAPI
  App -->|remaining server-side repositories| ProductDB
  App --> ProductBlob

  ProductAPI -->|commands and reads| ProductDB
  ProductAPI --> ProductBlob
  ProductAPI -->|workload JWT| LegalCore
  ProductWorker <-->|dispatch, checkpoints, results| ProductDB
  ProductWorker --> ProductBlob
  ProductWorker -->|internal HTTP| Parser
  ProductWorker -->|workload JWT| LegalCore
  ProductWorker --> Anthropic
  ProductWorker --> Voyage

  LegalCore -->|reader role| LegalDB
  LegalCore -->|verified originals| CorpusBlob
  LegalCore --> Voyage
  CorpusWorker <-->|source jobs and indexes| LegalDB
  CorpusWorker -->|original artifacts| CorpusBlob
  CorpusWorker --> Voyage
  ProductMigrator --> ProductDB
  LegalMigrator --> LegalDB

  Registry -.->|images| Public
  Registry -.->|images| Backend
  Vault -.->|scoped secrets| Public
  Vault -.->|scoped secrets| Backend
  Public -.->|telemetry| Logs
  Backend -.->|telemetry| Logs

  Integrator -.-> PublicLegal
  PublicLegal -.->|workload JWT| LegalCore
  MCP -.-> PublicLegal
  App --> Email

The app still has server-side product database access; not every request passes through Product API. DBOS and the document engine run inside the workers, not as separate services. The parser has no database or blob credentials. Product and legal are separate databases on the same PostgreSQL Flexible Server in the Terraform target; the blobs are separate private containers in one storage account.

Each workload has its own managed identity for registry pull, permitted blob access and secret-specific Key Vault grants. The public environment is reached through Front Door; the backend environment uses an internal load balancer and private DNS. Managed data is reached through private endpoints. Public Legal API is an implemented preview without Azure placement; MCP has no implementation yet. Services & ownership gives the capability-level status.

BoundaryWorkloads and access
PublicProduct app, website and docs; Public Legal API and MCP ingress are not provisioned
ProductProduct API and worker; product database and private blobs
DocumentsDocument jobs inside product-worker, shared documents-go package and separately deployed parser
LegalLegal Core and corpus worker; legal database and corpus originals
OperationsRestricted administration, telemetry and deployment control

Product-worker and corpus-worker are separate processes. Document jobs currently scale with product-worker; a separate document service is target work. Worker shutdown and publication authority are described in Workers & recovery.

Private data stores have no public application access. Use workload identity for Azure resources and scoped application credentials for internal APIs. Separate environment identities, secrets, databases and storage. Parser execution has restricted network/filesystem access.

Each workload receives only its own configuration. Terraform supplies public settings and versioned Key Vault references; configuration describes process ownership.

Deploy immutable release artifacts identified by digest. Run schema and configuration validation before admitting traffic. Liveness checks process health; readiness checks the dependencies needed to serve work. Shutdown stops admission, drains bounded work and leaves unfinished tasks recoverable.

Storage & indexes owns restore/deletion requirements and their unimplemented parts. A successful Terraform plan is not evidence of a tested restore.

Releases defines the intended CI, staging and production promotion pipeline and identifies the automation still to implement.

Terraform under infra/terraform/azure/ defines the intended environment boundaries; infra/compose.yaml and service Dockerfiles establish current local process boundaries. Terraform mocked tests check configuration shape, not live networking or permissions. Environment identity, private connectivity and production acceptance still require deployment evidence.