{"id":8933,"library":"dbx","title":"DataBricks CLI eXtensions (dbx)","description":"dbx is a Python CLI extension for Databricks that simplifies project development, deployment, and management workflows, especially for MLOps. It provides tools for structuring Databricks projects, building artifacts, and deploying them to various Databricks environments. The current version is 0.8.19, and it maintains an active release cadence with frequent updates.","status":"active","version":"0.8.19","language":"en","source_language":"en","source_url":"https://github.com/databrickslabs/dbx","tags":["databricks","cli","deployment","mlops","workflow"],"install":[{"cmd":"pip install dbx","lang":"bash","label":"Install dbx"}],"dependencies":[{"reason":"Core dependency for interacting with Databricks workspace APIs. Its configuration (`databricks configure`) is often managed alongside `dbx`.","package":"databricks-cli","optional":false}],"imports":[{"note":"Provides programmatic access to dbx project operations like building, deploying, and managing profiles. Assumes prior CLI configuration.","symbol":"dbx_api","correct":"from dbx.api import dbx_api"}],"quickstart":{"code":"import os\nfrom dbx.api import dbx_api\n\n# This example assumes you have a 'dbx.json' and 'deployment.yml'\n# in your current working directory, defining a dbx project.\n# It also assumes you have configured dbx credentials (e.g., via `dbx configure`)\n# or set environment variables like DBX_HOST and DBX_TOKEN.\n\nprint(\"Attempting to get project configuration...\")\ntry:\n    # Load the project configuration from dbx.json in the current directory\n    project_config = dbx_api.get_project_config()\n    print(f\"Project Name: {project_config.project_name}\")\n    print(f\"Project Type: {project_config.project_type}\")\n\n    # A simpler example: listing current connection profiles\n    print(\"\\nListing configured dbx connection profiles:\")\n    profiles = dbx_api.get_available_profiles()\n    if profiles:\n        for profile in profiles:\n            print(f\"- {profile}\")\n    else:\n        print(\"No profiles found. Run `dbx configure` to set one up.\")\n\nexcept Exception as e:\n    print(f\"Error interacting with dbx API. Ensure dbx is configured and project files exist. Error: {e}\")\n    print(\"Hint: Run `dbx configure` in your terminal to set up credentials.\")","lang":"python","description":"Demonstrates programmatic access to `dbx` for retrieving project configuration and listing profiles. This requires an existing `dbx` project setup with `dbx.json` and `deployment.yml` files, and configured Databricks credentials (e.g., via `dbx configure` or environment variables)."},"warnings":[{"fix":"Migrate your project configuration from `dbx_project.py` to the new `dbx.json` format. Refer to the official dbx migration guide for detailed steps.","message":"Project configuration format changed from `dbx_project.py` (Python object) to `dbx.json` (JSON file) starting with dbx v0.8.0. Old projects will not be recognized without migration.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Ensure you have run `dbx configure` to set up a profile, or explicitly set `DBX_HOST` and `DBX_TOKEN` environment variables for your session. Use `dbx configure --profile <profile_name>` to manage multiple profiles.","message":"dbx relies on correctly configured Databricks credentials and host information. This can be managed via `dbx configure` (which stores profiles locally) or by setting `DBX_HOST` and `DBX_TOKEN` environment variables.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always double-check your `deployment.yml` to ensure the `workspace_path` and `target` definitions (e.g., `dev`, `staging`, `prod`) correctly point to your desired Databricks workspace locations and clusters.","message":"When deploying, it's common to misconfigure the `workspace_path` or `target` in `deployment.yml`, leading to resources being deployed to unintended locations or errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `dbx configure` in your terminal to set up a default profile, or set `DBX_HOST` and `DBX_TOKEN` environment variables before running dbx commands. If using a specific profile, ensure it's selected or specified.","cause":"dbx has not been configured with Databricks credentials or host information, or the specified profile does not exist.","error":"Error: \"No profiles found. Run 'dbx configure' in your terminal.\""},{"fix":"Ensure that `dbx.json` is present in your current working directory. If your project file is elsewhere, you might need to change your directory or specify the path to `dbx.json`.","cause":"dbx could not find the project configuration file (`dbx.json`) in the current working directory.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'dbx.json'"},{"fix":"Edit your `deployment.yml` file and add a `workspace_path` entry under the specific target configuration, e.g., `targets: dev: workspace_path: /Shared/dbx/my_project_name`.","cause":"The deployment target (e.g., 'dev') in your `deployment.yml` file is missing the mandatory `workspace_path` property.","error":"Error: Invalid configuration for target 'dev': 'workspace_path' is required"},{"fix":"Verify the command syntax against the official dbx documentation. Ensure `dbx` is properly installed and its executable is in your system's PATH. Reinstall `dbx` if necessary: `pip install --upgrade dbx`.","cause":"The dbx CLI command or subcommand is misspelled, or it's not available in the currently installed dbx version, or dbx is not correctly installed/accessible in the PATH.","error":"Error: \"click.exceptions.BadParameter: Error: Unknown command 'deploy'\""}]}