Deploy agent to Databricks Apps using DAB (Databricks Asset Bundles). Use when: (1) User says 'deploy', 'push to databricks', or 'bundle deploy', (2) 'App already exists' error occurs, (3) Need to bind/unbind existing apps, (4) Debugging deployed apps.
Read .env to get DATABRICKS_CONFIG_PROFILE. All commands must include the profile:
databricks <command> --profile <profile>
# Step 1: Git commit and push
git add <changed files> && git commit -m "<message>" && git push
# Step 2: Workspace import (for every changed file)
databricks workspace import "//Users/[email protected]/cara-hydro-agent/files/app/app.py" \
--file app/app.py --profile transalta-generation --overwrite --format RAW
# Step 3: Deploy app
databricks apps deploy cara-hydro-chat --profile transalta-generation
NEVER do only git push. Databricks Apps serves from /Workspace/Users/.../files/ NOT GitHub.
# Pre-flight check
uv run preflight
# Validate bundle
databricks bundle validate
# Deploy
databricks bundle deploy
# Run/start app (REQUIRED after deploy)
databricks bundle run agent_openai_agents_sdk
# Bind existing app
databricks bundle deployment bind agent_openai_agents_sdk <existing-app-name> --auto-approve
databricks bundle deploy
databricks bundle run agent_openai_agents_sdk
databricks auth token | jq -r '.access_token'
curl -X POST <app-url>/invocations \
-H "Authorization: Bearer <oauth-token>" \
-H "Content-Type: application/json" \
-d '{"input": [{"role": "user", "content": "hi"}], "stream": true}'
databricks apps logs cara-hydro-chat --follow --profile transalta-generation
databricks apps get cara-hydro-chat --output json --profile transalta-generation | jq '{app_status, compute_status}'