Skip to main content

Deployment instructions

Follow these instructions to deploy the interactive examples to your Databricks workspace or to run them locally.

warning

These samples are experimental and meant for demonstration purposes only. They are provided as-is and without formal support by Databricks. Ensure your organization's security, compliance, and operational best practices are applied before deploying them to production.

Deploy to Databricks

  1. Navigate to the databricks-apps-cookbook GitHub repository and load it a Databricks Git folder in your Databricks workspace.
  2. In your Databricks workspace, switch to Compute -> Apps.
  3. Choose Create app.
  4. Under Choose how to start, select Custom and choose Next.
  5. Provide a name for your app and choose Create app.
  6. Once your app compute has started, choose Deploy.
  7. Navigate to your new Git folder and select either the dash or streamlit folder.
  8. Choose Deploy.
info

Check the Requirements tab of each recipe to understand what service principal permissions, Databricks resources, and Python packages are required to use it.

Run locally

  1. Clone the databricks-apps-cookbook GitHub repository or your fork to your local machine and switch into the databricks-apps-cookbook folder:

    git clone https://github.com/pbv0/databricks-apps-cookbook.git
    cd databricks-apps-cookbook
  2. Navigate to the sub-folder for the cookbook framework you want to run (either dash or streamlit). Create and activate a Python virtual environment in this folder venv. We recommend using separate environments for each framework:

    cd streamlit
    python3 -m venv .venv
    source .venv/bin/activate
  3. Install required packages:

    pip install -r requirements.txt
  4. Install the Databricks CLI and authenticate with your Databricks workspace using OAuth U2M, for example:

    databricks auth login --host https://my-workspace.cloud.databricks.com/
  5. Set required environment variables:

    export DATABRICKS_HOST=https://my-workspace.cloud.databricks.com/
  6. Run the cookbook app locally (make sure your virtual environment is activated).

    Streamlit:

    streamlit run app.py

    Dash:

    python app.py
info

Make sure you have a working network connection to your Databricks workspace. Some samples may only work when running on Databricks Apps and not locally, e.g., retrieving information from HTTP headers to identify users.