Skip to content

Generated SaaS Deployment

Target Architecture — Final-State Design

This page describes the deployment architecture of a Generated SaaS Product. Infrastructure is defined as code with Pulumi, pipelines are generated from ConnectSoft.DevOpsPipelineTemplate, and the runtime targets Azure Kubernetes Service (AKS) or Azure Container Apps. Everything here is generated alongside the product so it ships operable from day one.

A generated product is deployable and operable by construction. The DevOps Agent generates CI/CD pipelines, the Platform Agent generates Pulumi IaC, and the Runtime & Cloud platform provisions the target environment. No infrastructure is created by hand; the pipeline and IaC are the single path to production.

Runtime model

  • Container runtime. Each service and worker is containerized and deployed to AKS (Kubernetes) or Azure Container Apps, selectable per product based on scale and operational preference.
  • Stateless services. Services hold no local state; all state lives in the data tier (Azure SQL/PostgreSQL, Blob, Redis, Key Vault), enabling free horizontal scaling.
  • Ingress. The API Gateway is the single ingress; TLS termination, routing, and rate limiting happen at the edge.
  • Messaging. Azure Service Bus is the message backbone; MassTransit connects services and workers.

Infrastructure-as-Code (Pulumi)

  • Pulumi defines all cloud resources (cluster/Container Apps environment, databases, Service Bus, Blob, Redis, Key Vault, networking, managed identities) as code in the product's IaC project.
  • Per-environment stacks. Separate Pulumi stacks for dev/staging/prod, parameterized by configuration, with no drift between environments.
  • Idempotent + reviewable. IaC changes go through the same review and pipeline path as application code; pulumi preview runs in CI before apply.
  • Secrets. Pulumi provisions Key Vault and managed identities; application secrets are never embedded in IaC outputs.

CI/CD pipelines

flowchart LR
    Commit["Commit / PR"] --> Build["Build + Unit Test"]
    Build --> Scan["Static Analysis + Security Scan"]
    Scan --> Package["Containerize + Push to Registry"]
    Package --> IaCPreview["Pulumi Preview"]
    IaCPreview --> DeployStaging["Deploy to Staging (GitOps)"]
    DeployStaging --> IntegrationTest["Integration + Smoke Tests"]
    IntegrationTest --> Approve["Governance Approval Gate"]
    Approve --> DeployProd["Deploy to Production (GitOps)"]
    DeployProd --> Verify["Health + Post-Deploy Verification"]
Hold "Alt" / "Option" to enable pan & zoom
  • Pipelines are generated from ConnectSoft.DevOpsPipelineTemplate by the DevOps Agent.
  • GitOps delivery. Desired state is declared in Git; the cluster reconciles to it, giving auditable, revertible deployments.
  • Quality gates. Build, test, security scan, IaC preview, and a governance approval gate must pass before production.
  • Migrations. Database migrations (DatabaseModel.Migrations) run as a gated pipeline step before service rollout.

Deployment topology

flowchart TB
    subgraph Cluster["AKS / Container Apps Environment"]
        Gateway["API Gateway (replicas)"]
        Auth["Authorization Server (replicas)"]
        Services["Domain + Spine Services (replicas)"]
        Workers["Workers (scaled on queue depth)"]
        HealthAgg["Health Aggregator"]
    end
    subgraph Data["Managed Data Services"]
        SQL[("Azure SQL / PostgreSQL")]
        Bus["Azure Service Bus"]
        Blob[("Blob Storage")]
        Redis[("Redis")]
        Vault[("Key Vault")]
    end
    Ingress["Ingress / TLS"] --> Gateway
    Gateway --> Auth
    Gateway --> Services
    Services --> SQL
    Services --> Bus
    Workers --> Bus
    Services --> Redis
    Services --> Blob
    Auth --> Vault
    Services --> Vault
    HealthAgg --> Services
    Monitor["Application Insights / Azure Monitor"] --- Cluster
Hold "Alt" / "Option" to enable pan & zoom

Scaling

  • Horizontal pod/replica autoscaling for services based on CPU, memory, and request concurrency.
  • Queue-based worker scaling — workers scale on Service Bus queue depth/lag (KEDA on AKS, or Container Apps scale rules).
  • Data tier scaling — Azure SQL/PostgreSQL scale tiers and read replicas per environment; Redis sized to working set.
  • Per-tenant fairness — rate limiting and partitioned consumers prevent a single tenant from monopolizing capacity.

Configuration, secrets, and health

  • Configuration flows from environment-scoped settings and ConfigurationSetting; no environment-specific values are baked into images.
  • Secrets are read from Key Vault via managed identity at startup and on rotation (see security).
  • Health — every service exposes liveness/readiness probes; the ConnectSoft.HealthChecksAggregatorTemplate Health Aggregator composes them into a product-level health view consumed by the platform and ingress.

Implemented

The operational building blocks are real today: ConnectSoft.DevOpsPipelineTemplate (CI/CD), ConnectSoft.HealthChecksAggregatorTemplate (health aggregation), and Pulumi IaC templates. A generated product wires these into a complete, GitOps-delivered deployment.

How deployment contributes to the pillars

  • Traceability — every deployment is a Git-tracked, audited change linked to the commit and blueprint that produced it.
  • Reusability — pipelines and IaC are generated from shared templates, identical across products.
  • Autonomy — DevOps/Platform agents generate and operate the pipeline and infrastructure.
  • Governance — approval gates, IaC review, and GitOps auditability enforce controlled change.
  • Observability — post-deploy verification and health aggregation confirm releases; signals feed factory dashboards.
  • Multi-tenant scale — stateless services + autoscaling + queue-based worker scaling scale the product across many tenants.