Del via


Databricks Apps environment

Your Databricks app runs in a managed environment with the following binaries and resources:

  • Operating system: Ubuntu 22.04 LTS
  • Python environment: Python 3.11, running in a dedicated virtual environment. All dependencies are isolated within this environment. Apps that use uv can specify a different Python version. See Manage dependencies for a Databricks app.
  • uv version: 0.10.2
  • Node.js environment: Node.js version 22.16. Manage dependencies using npm and package.json.
  • System resources: By default, each app can use up to 2 virtual CPUs (vCPUs) and 6 GB of memory. Configure the compute size to adjust CPU and memory allocation based on your workload requirements. See Configure the compute size for a Databricks app.

View environment details

To view the environment for a specific app, including environment variables and installed packages, go to the Environment tab on the details page for the app. See View the details for a Databricks app.

Default environment variables

The following environment variables are available in every app:

Variable Description
DATABRICKS_APP_NAME The name of the running app.
DATABRICKS_WORKSPACE_ID The unique ID for the Databricks workspace the app belongs to.
DATABRICKS_HOST The URL of the Databricks workspace to which the app belongs.
DATABRICKS_APP_PORT The network port the app should listen on.
DATABRICKS_CLIENT_ID The client ID for the Databricks service principal assigned to the app.
DATABRICKS_CLIENT_SECRET The OAuth secret for the Databricks service principal assigned to the app.

App telemetry environment variables

When you enable telemetry for your app, Azure Databricks automatically configures the following environment variables in the app runtime:

Variable Value Description
OTEL_EXPORTER_OTLP_ENDPOINT http://localhost:4314 The OTLP collector endpoint
OTEL_EXPORTER_OTLP_PROTOCOL grpc The export protocol
OTEL_RESOURCE_ATTRIBUTES workspace.id=<id>,app.name=<name> Resource attributes for trace context
OTEL_SERVICE_NAME <your_app_name> The service name for telemetry data
OTEL_BSP_MAX_QUEUE_SIZE 10000 Maximum span queue size
OTEL_BLRP_MAX_QUEUE_SIZE 10000 Maximum log queue size
OTEL_BSP_MAX_EXPORT_BATCH_SIZE 512 Batch size for span exports
OTEL_BLRP_MAX_EXPORT_BATCH_SIZE 512 Batch size for log exports
OTEL_BSP_SCHEDULE_DELAY 1000 Span export interval (ms)
OTEL_BLRP_SCHEDULE_DELAY 1000 Log export interval (ms)

To learn more about configuring app telemetry, see Configure telemetry for Databricks Apps.

Framework environment variables

The Databricks Apps runtime automatically sets port and host variables for supported Python frameworks. You don't need to configure these manually. All port variables are set to the value of DATABRICKS_APP_PORT.

Framework Variables
Gradio GRADIO_SERVER_PORT, GRADIO_SERVER_NAME=0.0.0.0
Streamlit STREAMLIT_SERVER_PORT, STREAMLIT_SERVER_ADDRESS=0.0.0.0
FastAPI UVICORN_PORT, UVICORN_HOST=0.0.0.0
Uvicorn UVICORN_PORT, UVICORN_HOST=0.0.0.0
Flask FLASK_RUN_PORT, FLASK_RUN_HOST=0.0.0.0
Dash PORT
Express PORT

Additional Streamlit environment variables

The runtime also sets the following Streamlit-specific variables:

Variable Description
STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION Set to false. The Databricks Apps reverse proxy handles XSRF protection.
STREAMLIT_SERVER_ENABLE_CORS Set to false. The Databricks Apps reverse proxy handles CORS.
STREAMLIT_SERVER_HEADLESS Set to true so Streamlit runs without opening a browser window.
STREAMLIT_BROWSER_GATHER_USAGE_STATS Set to false to prevent sending usage stats to Streamlit.

No Node.js libraries are pre-installed in the Databricks Apps environment. For Node.js apps, you must explicitly list all dependencies in your package.json file to ensure they are installed at runtime.