Skip to content

Infrastructure

Environments

Environment URL Purpose
Production (prd) Not configured Production service. Databricks Apps apps-survey-analysis-prd
Staging (stg) Not configured Pre-release verification. Databricks Apps apps-survey-analysis-stg
Development (dev) https://sample-app-202510-96896088351718.aws.databricksapps.com/ Development environment. Databricks Apps apps-survey-analysis-dev
Local http://localhost:5173 Local development (Vite dev server + uvicorn :8000)

Architecture Diagram

graph TD
  Browser[Browser]
  Apps[Databricks Apps<br/>uvicorn: FastAPI + static SPA]
  Warehouse[(SQL Warehouse)]
  UC[(Unity Catalog<br/>cs.cs_dm)]
  GH[GitHub]
  Actions[GitHub Actions]
  GitFolder[Databricks Git folder]

  Browser --> Apps
  Apps -->|databricks-sql-connector<br/>OAuth M2M| Warehouse
  Apps -->|databricks-sdk WorkspaceClient| UC
  Warehouse --> UC

  GH --> Actions
  Actions -->|OIDC| GitFolder
  GitFolder --> Apps

The app runs as a single process. backend/main.py registers every router from backend/routes/, then a catch-all GET /{full_path:path} returns backend/static/index.html so SPA routing works.

Key Services

Service Purpose
Databricks Apps Hosts the app; command in app.yaml starts uvicorn
Databricks SQL Warehouse Runs queries against the aggregation views, addressed by DATABRICKS_HTTP_PATH
Unity Catalog Source of both the data (catalog cs / schema cs_dm) and its metadata
Databricks Git folder /Workspace/survey_analytics/<env>/secure/internal/apps/databricks-apps-survey-analysis; the deployment source
GitHub Actions Runs the deployment triggered by pushes to main / stg / prd

Deploy Flow

Branch Target Trigger
main dev Automatic (on push)
stg stg Automatic (on push)
prd prd Automatic (on push)

GitHub Actions (.github/workflows/deploy.yml) authenticates via OIDC federation (DATABRICKS_AUTH_TYPE: github-oidc) rather than an SP token, then runs two steps:

databricks repos update \
  /Workspace/survey_analytics/<env>/secure/internal/apps/databricks-apps-survey-analysis \
  --branch <branch>

databricks apps deploy apps-survey-analysis-<env> \
  --source-code-path /Workspace/survey_analytics/<env>/secure/internal/apps/databricks-apps-survey-analysis/nodejs-fastapi-hello-world-app

In other words, what gets deployed is exactly what is in git, including the built backend/static/.

For a manual deploy from a local machine, use databricks bundle deploy -t dev. Note that databricks.yml currently defines only the dev target (stg / prd are commented out).