Deployment Guide
Genie Workbench is deployed as a Databricks App. This guide covers both supported install paths:
- Method 1 (Recommended): Databricks Workspace Notebook — run
notebooks/install.pydirectly inside the Databricks workspace UI, using notebook-nativeWorkspaceClient()authentication. No local terminal, CLI profile, Node, npm, or uv setup required. - Method 2 (Backup): Local Terminal —
scripts/install.shplusscripts/deploy.sh, using the Databricks CLI and Asset Bundles.
Both paths deploy the same app and provision the same core resources. If you are already working inside Databricks, use Method 1.
Prerequisites
Workspace resources
A Databricks workspace with:
- Apps enabled
- A SQL Warehouse (Serverless recommended)
- A Unity Catalog with CREATE SCHEMA permission
- Lakebase Autoscaling available (optional but recommended for persistent scan history, starred agents, and agent sessions)
- Databricks Foundation Model APIs enabled for the curated Create Agent and Auto-Optimize model list
- Unity AI Gateway available in the workspace's region. LLM calls go through the gateway by default so their cost is attributed in
system.ai_gateway.usage; both installers send one test request and stop with guidance if it fails. To use the serving endpoints directly instead, install withllm_routeset toclassic
Enable required preview features
Before installing, enable these on the Databricks Previews page (workspace admins manage preview toggles):
- Databricks Apps – On-Behalf-Of User Authorization (Public Preview)
On-Behalf-Of User Authorization is what lets the app act as the signed-in user (OBO auth). Without it, Genie API calls that require user identity will fail. See Authentication & Permissions for details.
Installer permissions
The installer creates apps, UC objects, Lakebase projects, MLflow experiments, and jobs, and grants the app service principal across all of them. The person running the installer typically needs workspace-admin equivalents. If you are uncertain, have a workspace admin run the installer. The servicePrincipal.user role on the app service principal is not required: without it, the app sets the optimization job's run_as at startup. The installer grants the app access to Genie Agents, not to the data they reference: the Auto-Optimize tab checks the app service principal's read access per agent, and a run refuses to start on a schema it cannot read. See Authentication & Permissions for the full entitlement list.
Method 1 (notebook) prerequisites
- The repo cloned into a Databricks Git folder (covered in the steps below)
- A Serverless compute session (environment v5) that can run the notebook
Method 2 (local terminal) prerequisites
- Databricks CLI v0.297.2+ (validated by preflight)
- uv — Python package manager
- Node.js ^20.19.0 or >=22.12.0 and npm
- Python 3.11+
- Network access to your npm registry — required to install frontend npm dependencies during the build step. Databricks internal users can run
npm config set registry https://npm-proxy.dev.databricks.com/; external users useregistry.npmjs.org. If you are behind a corporate firewall or VPN that blocks this, allowlist the registry or connect via a network that permits outbound HTTPS to it. The deploy script validates this connectivity during pre-flight checks.
First-Time Setup
Choose one install path. Do not mix Method 1 and Method 2 for the same app instance unless you intentionally understand which source path is being deployed.
Method 1: Databricks Workspace Notebook (Recommended)
Use this path when you are already working inside Databricks. It runs entirely in the workspace UI — no local terminal, CLI profile, Node, npm, or uv required.
1. Clone the repo into your workspace
In the Databricks workspace, go to Workspace → Create → Git folder and paste the repo URL:
https://github.com/databricks-solutions/databricks-genie-workbench.git
This creates a Git folder containing the full project, including notebooks/install.py.
2. Run notebooks/install.py
Open notebooks/install.py, attach a Serverless compute session (environment v5), set the notebook widgets, and Run All.
| Widget | Required | Description |
|---|---|---|
app_name | Yes | Databricks App name to create or update |
catalog | Yes | Unity Catalog where the optimizer writes its tables and artifacts |
warehouse_id | Yes | Serverless SQL Warehouse ID used by the app and GSO |
lakebase_mode | Yes | create, existing, or skip |
lakebase_project_name | Conditional | Lakebase project name for create or existing; for create, blank keeps the project an existing app already uses, or <app-name>-lakebase for a new app. Leave blank when lakebase_mode is skip |
llm_route | No | gateway (default) sends LLM calls through Unity AI Gateway; classic calls the serving endpoints directly. There is no automatic fallback between them |
release_check | No | auto (default) turns the daily release check on for a new app; for an existing app it keeps the previous answer, or asks users on the Admin tab if there was none. yes / no set it explicitly |
The notebook user must hold the installer permissions. The notebook automatically grants visible Genie Agents to the app service principal, so the user needs CAN_MANAGE on each visible agent they want the app to manage.
3. What the notebook does
The installer uses the shared scripts.deploy_lib Python library and notebook-native WorkspaceClient() authentication. It:
- Creates or updates the Databricks App and resolves its service principal, then, on the
gatewayroute, sends one test request to Unity AI Gateway and stops with guidance if it fails - Generates a clean source folder under
/Workspace/Users/<you>/.genie-workbench-deploy/<app-name>/app(excluding deploy-only files, docs, tests, notebooks,scripts/,.git,.env*,node_modules, andrequirements.txt) - Provisions the UC schema, volume, GSO tables, Version Control tables/volume, CDF, and permissions
- Provisions or attaches Lakebase when requested
- Creates or updates the GSO optimization job (
<app-name>-gso-optimization-job) via the SDK/Jobs API - Renders a patched
app.yamlinto the generated source folder and patches app OAuth scopes and resources - Deploys the app from the generated source folder
- Grants the app SP access to visible Genie Agents
The Git folder is never modified — the generated workspace folder is deployment output; do not edit it by hand.
4. Updating a notebook-installed app
See Upgrading.
Method 2: Local Terminal Installer (Backup)
Use this path when you prefer to deploy from a local machine with the Databricks CLI.
1. Clone the repo
git clone https://github.com/databricks-solutions/databricks-genie-workbench.git
cd databricks-genie-workbench
2. Authenticate with Databricks CLI
databricks auth login --profile <workspace-profile>
Do NOT run databricks bundle init — it overwrites the project configuration.
3. Run the guided installer
./scripts/install.sh
The installer will:
- Check prerequisites (CLI version, Node, Python, npm, uv)
- Ask for your Databricks CLI profile
- Ask for catalog (auto-discovered from your workspace)
- Ask for SQL warehouse (auto-discovered)
- Optionally configure MLflow tracing (creates or links an experiment)
- Ask whether to enable the daily release check (default yes)
- Ask for app name
- Ask for the Lakebase Autoscaling project (create / existing / skip)
- Write
.env.deploywith your configuration (including the default LLM endpoint) - Run
scripts/deploy.shto build and deploy the app - Resolve the app's service principal
- Optionally grant the SP access to your existing Genie Agents
Lakebase (automated)
Lakebase provides persistent storage for scan history, starred agents, and agent sessions. Without it, the app uses in-memory storage (data lost on restart).
Lakebase setup is fully automated by both install paths:
- Creates a Lakebase Autoscaling project via the SDK
- Creates a Postgres role for the app's service principal
- Grants database permissions (CONNECT, CREATE ON DATABASE)
- Attaches the
postgresresource to the app via the Apps API
The app creates the genie schema and tables on first startup. Since the SP executes the DDL, it owns all objects — no manual grants needed.
The notebook path reads the Lakebase project from the lakebase_mode / lakebase_project_name widgets. The local terminal path asks for a project name (defaults to the app name, stored as GENIE_LAKEBASE_INSTANCE in .env.deploy). No manual steps required for either.
The GRANT step requires psycopg[binary] in the project venv (installed by uv sync). If unavailable, the script prints the commands to run manually in the Lakebase SQL Editor.
Upgrading an existing install
See Upgrading for upgrade steps for both install paths, how to find your version, what changes between versions, and upgrade troubleshooting.
Release update check
Genie Workbench can tell you when a newer release is available. The check lives on the Admin tab, which every user can open.
- What is called:
https://api.github.com/repos/databricks-solutions/databricks-genie-workbench/releases/latest, at most once a day per browser, plus whenever someone clicks Check now in Admin -> Settings. - Who calls it: the browser of whoever has the Admin tab open. The app server never calls the internet, and other pages never trigger the check.
- What is sent: nothing about your workspace. The request runs from a hidden, sandboxed frame, so the browser sends
Origin: nullinstead of the app's address, with no referrer and no cookies. The installed version stays in the browser (the comparison happens locally). GitHub sees the browser's IP address and user agent, the same as visiting github.com. - What you see: a dot on the Admin tab and a banner on the Admin Dashboard ("Genie Workbench 0.2.2 is available (you're on 0.2.1)") with links to the release notes and the upgrade steps.
Choosing at install. The terminal installer asks (default yes) and saves GENIE_UPDATE_CHECK in .env.deploy. The notebook installer uses the release_check widget. A true or false chosen at install is locked: Admin -> Settings shows the state, but it cannot be changed in the app.
Upgrading from an earlier version. If no choice was recorded at install, anyone who opens the Admin tab sees a one-time banner until someone answers (turn the check on, or decline). With Lakebase, that answer applies to everyone using the app, and the banner says so; anyone can change it later in Admin -> Settings. Without Lakebase, each browser keeps its own answer.
Turning it off later. Set GENIE_UPDATE_CHECK=false in .env.deploy and run ./scripts/deploy.sh --update, or set the notebook release_check widget to no and rerun the installer.
Restricted networks. If a browser cannot reach api.github.com (blocked, offline, or rate limited), nothing breaks: Admin -> Settings shows "Couldn't reach GitHub" and the browser tries again a day later.
What deploy.sh Does
This applies to Method 2 (local terminal). The notebook installer runs the equivalent steps through the scripts.deploy_lib library instead — see What the notebook does.
Full Deploy (8 steps)
- Pre-flight checks — validates tools, CLI profile, warehouse, catalog, app state
- Build frontend —
npm ci+npm run build(strict lockfile) - Create app —
databricks apps create(skipped if app already exists) - Sync files —
databricks sync --full+ explicitfrontend/dist/upload - Grant UC permissions — resolves app SP, creates GSO schema/tables and the Version Control tables/volume, grants SP access, enables CDF
- Set up optimization job — builds GSO wheel, uploads notebooks, creates/finds the Databricks job, grants SP CAN_MANAGE
- Redeploy app — patches
app.yamlwith config values, configures scopes, deploys - Verify — checks critical files, waits for deployment to succeed
Deploy Commands
./scripts/deploy.sh # Full deploy
./scripts/deploy.sh --update # Code-only update (skips app creation)
./scripts/deploy.sh --destroy # Tear down app and clean up jobs
./scripts/deploy.sh --destroy --auto-approve # Tear down without confirmation
What --update skips
--update skips step 3 (app creation). Use it for iterating on code changes after the initial deploy.
What --destroy cleans up (and what it doesn't)
--destroy deletes:
- The Databricks App
- Runtime-created jobs
- The bundle-managed optimization job
It does not remove:
- Lakebase data (the
genieschema indatabricks_postgres) - Unity Catalog schema/tables (
<catalog>.genie_space_optimizerand its tables) - Genie Agent SP permissions granted during install
- MLflow experiments created during install
- Synced tables (if manually created)
Clean these up manually if you want a full teardown.
Configuration Reference
Set these in .env.deploy or as environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
GENIE_WAREHOUSE_ID | Yes | — | SQL Warehouse ID |
GENIE_CATALOG | Yes | — | Unity Catalog name (needs CREATE SCHEMA) |
GENIE_APP_NAME | No | genie-workbench | Databricks App name (unique in workspace) |
GENIE_DEPLOY_PROFILE | No | DEFAULT | Databricks CLI profile name |
GENIE_LLM_MODEL | No | databricks-claude-sonnet-4-6 | LLM model (sent as system.ai.* on the gateway route; the serving endpoint name on classic) |
GENIE_LLM_ROUTE | No | gateway | gateway (Unity AI Gateway) or classic (serving endpoints directly) |
GENIE_BYOK_ENABLED | No | false | true accepts a Unity Catalog model id as the model on the gateway route |
GENIE_LAKEBASE_INSTANCE | No | empty | Lakebase Autoscaling project name (auto-provisioned by deploy); installer suggests <app-name>-lakebase |
GENIE_UPDATE_CHECK | No | empty | true / false for the daily release check. Empty: users are asked on the Admin tab |
Manual Setup (Method 2, without installer)
If you prefer non-interactive local terminal setup:
1. Create .env.deploy
cat > .env.deploy <<'EOF'
GENIE_WAREHOUSE_ID=<your-sql-warehouse-id>
GENIE_CATALOG=<your-catalog-name>
GENIE_APP_NAME=genie-workbench
GENIE_DEPLOY_PROFILE=genie-workbench
GENIE_LLM_MODEL=databricks-claude-sonnet-4-6
GENIE_LAKEBASE_INSTANCE=genie-workbench
EOF
2. Deploy
./scripts/deploy.sh
Platform Build Strategy
The Databricks Apps platform detects package.json at the root and runs npm install then npm run build. To avoid cross-platform failures and redundant rebuilds:
- Root
postinstall: No-op. Frontend deps are installed bydeploy.shlocally. - Root
build: Checks for pre-builtfrontend/dist/index.html. If present (uploaded bydeploy.sh), skips the rebuild. Falls back to a full build only if dist is missing. - Python deps: Use
uv syncon the platform (becauserequirements.txtis excluded via.databricksignore). This gives a clean venv with SHA256-verified hashes.
Dependency Security
All dependencies are pinned to exact versions with integrity hashes. Lock files are the source of truth.
| File | Covers | Verification |
|---|---|---|
uv.lock | Workspace-wide Python transitive deps (root + GSO) | SHA256 hashes |
frontend/package-lock.json | Frontend npm deps | SHA-512 integrity |
Updating Python dependencies
uv lock --upgrade-package <package-name>
uv export --frozen --no-dev --no-hashes --format requirements-txt \
| grep -v "^-e " > requirements.txt
echo "-e ./packages/genie-space-optimizer" >> requirements.txt
python scripts/export_gso_job_requirements.py
git add uv.lock requirements.txt packages/genie-space-optimizer/requirements-job.txt
Do not edit requirements.txt or requirements-job.txt manually. Both are generated from uv.lock.
requirements-job.txt pins the GSO optimization job's transitive dependencies to the
versions in uv.lock. Every job environment installs it next to the GSO wheel, so job
runs don't re-resolve against the live package index. It leaves out packages the
serverless base environment already ships (listed in
packages/genie-space-optimizer/serverless-env-v4-base-packages.txt), so the job
never replaces base-image packages. Refresh that snapshot whenever the job's
serverless environment_version changes. Databricks also patches base images in
place without a version bump, so re-capture the snapshot before relying on a
version it lists.
Updating npm dependencies
cd frontend
npm install <package>@<new-version>
# Update package.json to exact version (remove ^ prefix)
git add package.json package-lock.json
Typical Workflow
Method 1 (notebook): pull the latest repo changes in the Databricks Git folder and rerun notebooks/install.py from the top — for both first-time installs and updates.
Method 2 (local terminal):
# First time
./scripts/install.sh
# After code changes
./scripts/deploy.sh --update
# Tear down
./scripts/deploy.sh --destroy
Related Documentation
- Operations Guide — post-deploy monitoring and management
- Authentication & Permissions — SP permissions granted during deploy
- Troubleshooting — common deployment issues
- Environment Variables — full variable reference