Skip to main content

Configuration

This guide covers environment variables and configuration options for AppKit applications.

App deployment configuration

app.yaml file

The app.yaml file configures your app's runtime environment in Databricks Apps.

Basic example:

command:
- node
- build/index.mjs
env:
- name: DATABRICKS_WAREHOUSE_ID
valueFrom: sql-warehouse

Command specification

Specify how to start your app in the command field:

command:
- node
- build/index.mjs

This runs the production build of your AppKit server (created by npm run build).

Binding a SQL warehouse

To use the analytics plugin, bind a SQL warehouse in your app.yaml:

env:
- name: DATABRICKS_WAREHOUSE_ID
valueFrom: sql-warehouse

This makes the warehouse ID available to your app at runtime. The valueFrom: sql-warehouse directive tells Databricks Apps to inject the configured warehouse ID.

For advanced configuration options (authorization, networking, resource limits), see the Databricks Apps Configuration documentation.

Environment variables

Required for Databricks Apps deployment

These are typically provided by Databricks Apps runtime (exact set can vary by platform/version):

VariableDescription
DATABRICKS_HOSTWorkspace URL (e.g. https://xxx.cloud.databricks.com)
DATABRICKS_APP_PORTPort to bind (default: 8000)
DATABRICKS_APP_NAMEApp name in Databricks

Required for SQL queries (analytics plugin)

VariableDescriptionHow to Set
DATABRICKS_WAREHOUSE_IDSQL warehouse IDIn app.yaml: valueFrom: sql-warehouse

See the App deployment configuration section above for details on how to bind this variable.

Optional variables

VariableDescriptionDefault
DATABRICKS_WORKSPACE_IDWorkspace IDAuto-fetched from API
NODE_ENV"development" or "production"
FLASK_RUN_HOSTHost to bind0.0.0.0

Telemetry (optional)

VariableDescription
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry collector endpoint
OTEL_SERVICE_NAMEService name for traces

Local development authentication

For local development, you need to authenticate with Databricks. Choose one of the following options:

Configure authentication once using the Databricks CLI:

databricks auth login --host [host] --profile [profile-name]

If you use DEFAULT as the profile name, you can run your dev server directly:

npm run dev

To run with a specific profile, set the DATABRICKS_CONFIG_PROFILE environment variable:

DATABRICKS_CONFIG_PROFILE=my-profile npm run dev

Note: Some Databricks SDK versions use DATABRICKS_PROFILE instead of DATABRICKS_CONFIG_PROFILE.

Option 2: Environment variables

export DATABRICKS_HOST="https://xxx.cloud.databricks.com"
export DATABRICKS_TOKEN="dapi..."
export DATABRICKS_WAREHOUSE_ID="abc123..."
npm run dev

Option 3: .env file (auto-loaded by AppKit)

Create a .env file in your project root (add to .gitignore!):

DATABRICKS_HOST=https://xxx.cloud.databricks.com
DATABRICKS_TOKEN=dapi...
DATABRICKS_WAREHOUSE_ID=abc123...

Then run:

npm run dev

Advanced configuration

For advanced Databricks Apps configuration (authorization, networking, resource limits), refer to the Databricks Apps Configuration documentation.

See also