5. C# App on Kubernetes

C#

What we’re building

A small full-stack application — frontend and backend in a single ASP.NET Core container — deployed onto the AKS cluster provisioned in the previous chapters and backed by a managed PostgreSQL database.

ComponentTechnologyDetails
FrontendStatic HTML served by ASP.NET CoreInput box + submit button; displays all submitted texts below
BackendASP.NET Core minimal APIPOST /texts writes timestamp + text; GET /texts returns JSON
DatabasePostgreSQL (Azure Flexible Server)Automatic SQLite fallback when DB_CONNECTION_STRING is not set

The fallback to SQLite means the app runs entirely locally with dotnet run — no database server needed during development.

Delivery path

  1. Build the app and run it locally (SQLite)
  2. Containerize and push the image to ACR
  3. Deploy to Kubernetes with kubectl and raw YAML
  4. Provision a managed PostgreSQL database with Pulumi
  5. Replace the raw manifests with Pulumi-managed Kubernetes resources
  6. (Stretch) Package everything as a Helm chart