- macOS (Apple Silicon or Intel)
- Homebrew installed
- Git installed
- Databricks Workspace
- Databricks account with appropriate permissions
Check whether Databricks CLI is already installed.
which databricksCheck the installed version.
databricks --versionExample (old CLI):
Version: 0.17.8
The legacy CLI (0.x) does not support:
databricks auth loginIf installed using pip:
pip uninstall databricks-clior
pip3 uninstall databricks-cliIf installed using Homebrew:
brew uninstall databricksbrew tap databricks/tapNewer versions of Homebrew require explicit trust.
Trust the entire tap:
brew trust databricks/tapor trust only the Databricks formula:
brew trust --formula databricks/tap/databricksbrew install databricksdatabricks versionExpected output:
Databricks CLI v1.7.0
Login to your workspace.
databricks auth login --host https://dbc-d40d7b72-eeb2.cloud.databricks.comWhen prompted:
Databricks profile name [dbc-d40d7b72-eeb2]:
Press Enter to use the default profile or provide a custom profile name.
The CLI opens a browser for authentication.
After successful login, your credentials are stored in:
~/.databrickscfg
List available authentication profiles.
databricks auth profilesDisplay information about the currently authenticated user.
databricks current-user meExpected output:
{
"userName": "your-email@company.com",
...
}
cat ~/.databrickscfgExample:
[dbc-d40d7b72-eeb2]
host = https://dbc-d40d7b72-eeb2.cloud.databricks.com
auth_type = pator
auth_type = oauthgit init
git add .
git commit -m "Initial Commit"
git remote add origin https://github.com/company/customer-etl.git
git push origin mainInside the Databricks workspace:
- Workspace
- Repos
- Add Repo
- Connect GitHub
- Select Repository
Repository structure:
Repos
└── customer-etl
├── src
├── configs
└── requirements.txt
Navigate to:
Compute
Click:
Create Compute
Recommended settings:
- Databricks Runtime LTS
- Photon Enabled
- Autoscaling
- Job Cluster (Production)
Example:
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
df = spark.read.csv("/mnt/raw/customer.csv", header=True)
df.write.mode("overwrite").format("delta").save("/mnt/gold/customer")Execute the script interactively from the Databricks workspace.
Navigate to:
Workflows
Create:
New Job
Configure:
- Task Type: Python Script
- Path:
/Repos/customer-etl/src/etl.py
Select a cluster or create a Job Cluster.
Example:
--env=prod
--date=2026-07-11
Python example:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--env")
parser.add_argument("--date")
args = parser.parse_args()Example:
pandas
pyarrow
delta-spark
requests
or install from:
requirements.txt
Examples:
- Hourly
- Daily
- Weekly
- Cron
Cron example:
0 2 * * *
Runs daily at 2:00 AM.
Manual execution:
Run Now
Or using the Databricks CLI:
databricks bundle run customer-etlDeploy:
databricks bundle deployValidate:
databricks bundle validateRun:
databricks bundle run customer-etlNavigate to:
Workflows
View:
- Job Status
- Run History
- Logs
- Spark UI
- Cluster Details
- Failed Tasks
Developer
│
▼
Write PySpark Code
│
▼
Git Commit
│
▼
Git Push
│
▼
Databricks Repos
│
▼
Workflow Job
│
▼
Cluster Starts
│
▼
PySpark Executes
│
▼
Delta Tables
│
▼
Job Logs
│
▼
Monitoring
databricks versiondatabricks auth login --host https://dbc-d40d7b72-eeb2.cloud.databricks.comdatabricks auth profilesdatabricks current-user medatabricks bundle validatedatabricks bundle deploydatabricks bundle run customer-etlThis workflow covers:
- Installing the Databricks CLI
- Trusting the Homebrew tap
- Authenticating to Databricks
- Validating authentication
- Connecting Git repositories
- Creating compute clusters
- Running PySpark jobs
- Creating Databricks Workflow jobs
- Scheduling production jobs
- Deploying with Databricks Asset Bundles
- Monitoring production executions