/databricks-skills:productionize-app-dabfrom databricks-skills
Wraps a Dash, Streamlit, Reflex, or FastAPI cookbook app in a Databricks Asset Bundle (DAB) with framework-specific src/app layout, app.yaml commands, and CI/CD secrets.
Ships in databricks-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Skill id: productionize-app-dab.
| Phase | Skill | What it does |
|---|---|---|
| 1 — Implement | build-app (../build-app/SKILL.md) | Choose Dash / Streamlit / Reflex / FastAPI, map README recipes to docs/docs/ + sample code, ship app.yaml for local/workspace run. |
| 2 — Bundle (DAB) | productionize-app-dab (this file) | Keep the same framework choice; package that app under src/app/ and add databricks.yml + resources/ so databricks bundle deploy owns lifecycle and environments. |
Do not productionize until the app runs from the cookbook folder (or equivalent). Switching framework after bundling means redoing src/app contents and app.yaml command.
Pattern origin: Minimal layout matches the public pbv0/databricks-apps-dabs reference (bundle root, resources/app.yml, src/app, optional job + CI)—embedded here without requiring downloads.
resources/app.yml declares an apps resource with source_code_path: ../src/app.databricks.yml defines targets (e.g. dev / prod) and workspace.host per environment.databricks bundle validate → deploy → run <app-key> against the chosen target.DATABRICKS_HOST, DATABRICKS_CLIENT_ID, DATABRICKS_CLIENT_SECRET.app.yaml from the matching cookbook sample.project-root/
├── databricks.yml
├── resources/
│ ├── app.yml
│ └── job.yml # optional
├── src/
│ ├── app/ # packaged cookbook app (structure varies by framework ↓)
│ └── job/ # optional bundle job code
└── README.md
databricks.yml (same idea for every framework—adjust bundle.name and app key my-app):
bundle:
name: my-databricks-app
include:
- resources/*.yml
targets:
dev:
mode: development
default: true
workspace:
host: https://YOUR-DEV-WORKSPACE.cloud.databricks.com/
resources:
apps:
my-app:
name: "my-app-dev"
prod:
mode: production
workspace:
host: https://YOUR-PROD-WORKSPACE.cloud.databricks.com/
root_path: /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}
permissions:
- user_name: ${workspace.current_user.userName}
level: CAN_MANAGE
resources/app.yml (minimal—the resources.apps.<key> must match databricks bundle run <key>):
resources:
apps:
my-app:
name: "my-app"
source_code_path: ../src/app
description: "Databricks App deployed via Asset Bundle."
Optional job-linked app and resources/job.yml blocks are identical across frameworks—see end of this file.
src/app/Copy from the cookbook folder dash/, streamlit/, reflex/, or fastapi/ into src/app/, preserving relative paths so imports and framework conventions still work.
| Framework | Copy from repo folder | Must exist under src/app/ | app.yaml command (production-shaped) |
|---|---|---|---|
| Streamlit | streamlit/ | app.py, view_groups.py, views/, assets/, requirements.txt, .streamlit/ if used | ["streamlit", "run", "app.py"] |
| Dash | dash/ | app.py, pages/, assets/, requirements.txt | ["python", "app.py"] |
| Reflex | reflex/ | Whole tree: rxconfig.py, app/ (pages, states, …), requirements.txt, app.yaml already at reflex root in cookbook—place those files so reflex run resolves (same layout as sample; src/app = reflex project root) | ["reflex", "run", "--env", "prod"] |
| FastAPI | fastapi/ | app.py (ASGI app), routes/, config/, requirements.txt, tests optional | ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] |
app.py drives st.navigation; do not split command per view.app.yaml example:command:
- "streamlit"
- "run"
- "app.py"
env:
- name: DATABRICKS_WAREHOUSE_ID
valueFrom: sql_warehouse
dash.pages loads pages/ automatically; app.py hosts sidebar—one command only.app.yaml example:command:
- "python"
- "app.py"
env:
- name: DATABRICKS_WAREHOUSE_ID
valueFrom: sql_warehouse
src/app/ as the Reflex project root (mirror reflex/ in the cookbook: rxconfig.py beside app/ package).reflex run --env prod expects that layout; CI or env flags may appear in sample app.yaml—merge with workspace valueFrom as needed.app.yaml example:command:
- "reflex"
- "run"
- "--env"
- "prod"
env:
- name: DATABRICKS_WAREHOUSE_ID
valueFrom: sql_warehouse
command starts uvicorn only; routes live under routes/ inside src/app/.0.0.0.0 and align port with DATABRICKS_APP_PORT / bundle expectations (default 8000).app.yaml example:command:
- "uvicorn"
- "app:app"
- "--host"
- "0.0.0.0"
- "--port"
- "8000"
env:
- name: DATABRICKS_WAREHOUSE_ID
valueFrom: sql_warehouse
PYTHONPATH / imports match app:app (module app with attribute app), same as cookbook fastapi/ layout.databricks auth login --host https://YOUR-WORKSPACE.cloud.databricks.com/
databricks bundle validate -t dev
databricks bundle deploy -t dev
databricks bundle run my-app -t dev
Replace my-app with your resources.apps key. Use -t prod when the prod target is configured.
| Secret | Purpose |
|---|---|
DATABRICKS_HOST | Workspace URL |
DATABRICKS_CLIENT_ID | Service principal client ID |
DATABRICKS_CLIENT_SECRET | Service principal secret |
Steps: checkout → install Databricks CLI → export secrets for OAuth M2M → databricks bundle deploy -t prod. Gate prod on protected branches or releases.
resources/job.yml:
resources:
jobs:
hello_world:
name: Serverless Hello World job
tasks:
- task_key: task
spark_python_task:
python_file: ../src/job/main.py
environment_key: default
environments:
- environment_key: default
spec:
client: "1"
resources/app.yml fragment (job must exist):
resources:
apps:
hello-world-app:
name: "hello-world-app"
source_code_path: ../src/app
resources:
- name: "app-job"
job:
id: ${resources.jobs.hello_world.id}
permission: "CAN_MANAGE_RUN"
build-app framework and runnable app.yaml in the cookbook folder.src/app/ and copy that framework’s tree (table above).app.yaml command block + env / valueFrom for Streamlit / Dash / Reflex / FastAPI.databricks.yml + resources/app.yml; source_code_path: ../src/app.databricks bundle validate → deploy → bundle run.source_code_path is relative to resources/app.yml.valueFrom names must match resources attached in bundle and workspace configuration.rxconfig.py / app/ layout is the most common bundle failure—mirror the cookbook reflex/ tree exactly under src/app/.uvicorn module path (app:app) breaks deploy—match fastapi/app.py export.src/app/requirements.txt if not on the Apps image.build-app — prerequisite: runnable cookbook app + app.yaml.databricks-skills/README.md — Skill sections index (all skills under databricks-skills/, not framework folders).Productionizing packages one cookbook framework directory into src/app/ and adds bundle metadata at repo root. It does not replace dash/, streamlit/, reflex/, fastapi/ in the cookbook—those remain source-of-truth samples. Feature and doc changes still follow README and CONTRIBUTING.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/cookbook-aimlInvoke ML models, run vector search, and connect to MCP servers from Databricks Apps. Use when the user wants to call a model serving endpoint, query a vector search index, use LLMs/embeddings, or connect to an MCP server in Dash, Streamlit, Reflex, or FastAPI./cookbook-authenticationImplement authentication in Databricks Apps: get current user info, on-behalf-of-user (OBO) auth, service principal auth, and OAuth patterns. Use when the user asks about auth, user tokens, service principals, OAuth, or OBO in Dash, Streamlit, Reflex, or FastAPI./cookbook-biEmbed AI/BI dashboards and integrate Genie Spaces into Databricks Apps. Use when the user wants to embed a Databricks dashboard or build a chat interface with the Genie Conversations API in Dash, Streamlit, or Reflex.npx claudepluginhub databricks-solutions/databricks-apps-cookbook --plugin databricks-skillsOther plugins' skills for the same job