Production-ready templates for building data platforms on Databricks with Unity Catalog and Delta Lake.
Skip the months of trial and error. This kit gives you the same patterns and architecture used by data platform teams at scale — fully documented, customizable, and ready to deploy.
| Module | What It Does |
|---|---|
| config/ | Environment detection, secret management, structured logging |
| medallion_bootstrap/ | One-command setup of your bronze/silver/gold catalog structure with RBAC |
| ingestion_templates/ | Battle-tested pipelines for APIs, databases, files, and streaming |
| cicd_templates/ | Azure DevOps & GitHub Actions pipelines, deployment scripts, test runner |
| unity_catalog_setup/ | SQL scripts for catalogs, external locations, credentials, and governance |
21 files — every one fully runnable, type-hinted, and documented.
Upload this kit to a Databricks Repo or the workspace file system:
/Repos/<your-user>/databricks-starter-kit/
Or use the Databricks CLI:
databricks repos create \
--url https://github.com/your-org/databricks-starter-kit \
--provider githubEdit config/environment.py to register your workspace IDs:
WORKSPACE_ENV_MAP: dict[str, str] = {
"1234567890123456": "dev", # Your dev workspace org ID
"2345678901234567": "staging", # Your staging workspace
"3456789012345678": "prod", # Your production workspace
}Update storage account names and catalog prefixes to match your naming conventions.
Edit medallion_bootstrap/config.py with your catalog names and team groups, then run:
# In a Databricks notebook — run these in order:
%run ./medallion_bootstrap/01_create_catalogs
%run ./medallion_bootstrap/02_create_schemas
%run ./medallion_bootstrap/03_grant_permissionsThis creates your full bronze → silver → gold catalog structure with proper RBAC in minutes.
from ingestion_templates.api_ingestion import ApiIngestionPipeline, ApiSourceConfig
pipeline = ApiIngestionPipeline(
pipeline_name="demo_api_load",
source_system="demo_api",
source_class="users",
api_config=ApiSourceConfig(
base_url="https://jsonplaceholder.typicode.com",
endpoint="/users",
),
)
pipeline.run()databricks-starter-kit/
│
├── README.md # This file
├── LICENSE # MIT License
│
├── config/
│ ├── environment.py # Environment detection & workspace config
│ ├── secrets.py # Secret management (Key Vault, scopes, env vars)
│ └── logging_config.py # Structured logging with Delta table sink
│
├── medallion_bootstrap/
│ ├── config.py # Catalog, schema, and permission definitions
│ ├── 01_create_catalogs.py # Create bronze/silver/gold Unity Catalogs
│ ├── 02_create_schemas.py # Create schemas within each catalog
│ └── 03_grant_permissions.py # Grant RBAC permissions to groups
│
├── ingestion_templates/
│ ├── base_pipeline.py # Abstract base class — merge, append, SCD2, dedup
│ ├── api_ingestion.py # REST API ingestion with pagination & retry
│ ├── database_ingestion.py # JDBC ingestion (SQL Server, PostgreSQL, Oracle, MySQL)
│ ├── file_ingestion.py # Auto Loader (cloudFiles) for CSV/JSON/Parquet/Avro/XML
│ └── streaming_ingestion.py # Event Hub & Kafka streaming with checkpoints
│
├── cicd_templates/
│ ├── azure_devops_pipeline.yml # Multi-stage Azure DevOps pipeline
│ ├── github_actions_workflow.yml # GitHub Actions with OIDC & environment protection
│ ├── deploy_notebooks.py # Deploy workflows & notebooks via REST API
│ └── run_tests.py # Test runner — tag validation, structure checks, secrets scan
│
└── unity_catalog_setup/
├── setup_catalogs.sql # SQL to create catalogs with tags and properties
├── setup_external_locations.sql # External locations for each data layer
├── setup_credentials.sql # Storage credentials (Azure MI, SP, AWS IAM, GCP SA)
└── data_governance_policies.md # Governance playbook — RBAC, classification, DQ, audit
Follow this guide to get databricks starter kit up and running in your environment.
environment.py — Auto-detects which Databricks workspace you're running in and returns the correct environment config (dev/staging/prod). Uses the workspace org ID for detection, with a serverless-compatible fallback via workspace URL parsing.
from config.environment import get_environment
env = get_environment()
print(env.name) # "dev"
print(env.catalog_prefix) # "dev"
print(env.storage.raw) # "abfss://raw@styourorgdev.dfs.core.windows.net"secrets.py — Unified secret access with layered lookup: Databricks Secret Scope → Azure Key Vault → environment variables. Includes JDBC connection string builder and in-memory caching with TTL.
from config.secrets import SecretManager
secrets = SecretManager()
api_key = secrets.get("my-api-key")
jdbc_url = secrets.jdbc_url("my-database", driver="sqlserver")logging_config.py — Structured logging with correlation IDs for tracing a pipeline run across stages. Optionally flushes logs to a Delta table for persistent audit trail and dashboards.
from config.logging_config import PipelineLogger
logger = PipelineLogger(pipeline_name="crm_sync", environment="prod")
logger.info("Starting extraction", extra={"table": "accounts"})
logger.log_metric("rows_processed", 152_000)
logger.flush_to_delta("audit.pipeline_logs")Creates your entire Unity Catalog structure — catalogs, schemas, and permissions — from a single configuration file.
What it creates:
| Layer | Catalog | Schemas (customizable) |
|---|---|---|
| Bronze | {env}_bronze | raw, cdc, streaming |
| Silver | {env}_silver | cleansed, conformed, enriched |
| Gold | {env}_gold | analytics, reporting, features |
Permissions are preset-based — assign groups like data_readers, data_engineers, data_admins with sensible defaults or customize granularly.
Edit medallion_bootstrap/config.py once, then the three scripts handle the rest idempotently (safe to re-run).
All pipelines extend BasePipeline, which provides:
append, merge (upsert), overwrite, scd2 (Slowly Changing Dimension Type 2)_etl_load_timestamp_utc, _source_system, _source_filename added automaticallyfix_column_names() replaces spaces, dots, and special characters#### API Ingestion (api_ingestion.py)
REST API ingestion with:
pipeline = ApiIngestionPipeline(
pipeline_name="salesforce_accounts",
source_system="salesforce",
source_class="accounts",
api_config=ApiSourceConfig(
base_url="https://your-instance.salesforce.com",
endpoint="/services/data/v58.0/query",
auth_type="bearer",
pagination_type="cursor",
cursor_field="nextRecordsUrl",
),
)
pipeline.run()#### Database Ingestion (database_ingestion.py)
JDBC ingestion with:
pipeline = DatabaseIngestionPipeline(
pipeline_name="erp_customers",
source_system="erp",
source_class="customers",
jdbc_config=JdbcSourceConfig(
host="erp-sql-server.database.windows.net",
database="erp_prod",
schema="dbo",
table="Customers",
driver_type="sqlserver",
load_mode="incremental",
watermark_column="ModifiedDate",
),
)
pipeline.run()#### File Ingestion (file_ingestion.py)
Cloud Files (Auto Loader) ingestion with:
foreachBatch writer for merge/upsert targetspipeline = FileIngestionPipeline(
pipeline_name="landing_csvs",
source_system="external_vendor",
source_class="transactions",
file_config=FileSourceConfig(
source_path="abfss://landing@storage.dfs.core.windows.net/vendor/",
file_format="csv",
header=True,
trigger_mode="trigger_once",
),
)
pipeline.run()#### Streaming Ingestion (streaming_ingestion.py)
Event Hub and Kafka ingestion with:
from ingestion_templates.streaming_ingestion import (
StreamingIngestionPipeline,
EventHubConfig,
)
pipeline = StreamingIngestionPipeline(
pipeline_name="clickstream_events",
source_system="event_hub",
source_class="clickstream",
streaming_config=EventHubConfig(
namespace="your-eventhub-namespace",
topic="clickstream",
consumer_group="databricks-consumer",
auth_type="oauth",
),
)
pipeline.run()#### Azure DevOps (azure_devops_pipeline.yml)
Multi-stage pipeline with:
#### GitHub Actions (github_actions_workflow.yml)
Workflow with:
#### Deployment Script (deploy_notebooks.py)
CLI tool that:
# Deploy a workflow
python deploy_notebooks.py deploy-workflow \
--workspace-url https://adb-123.azuredatabricks.net \
--file workflows/my_pipeline.json
# Dry run
python deploy_notebooks.py deploy-workflow \
--file workflows/my_pipeline.json \
--dry-run#### Test Runner (run_tests.py)
Validates your Databricks project:
python run_tests.py --workflow-dir workflows/ --output results.xmlSQL scripts and a governance playbook for Unity Catalog:
setup_catalogs.sql — Creates bronze/silver/gold/audit catalogs with tags and default schemassetup_external_locations.sql — External locations for each layer (raw, bronze, silver, gold, checkpoints, export)setup_credentials.sql — Storage credential templates for Azure Managed Identity, Service Principal, AWS IAM Role, and GCP Service Accountdata_governance_policies.md — Complete governance playbook covering:Every naming pattern is configurable. Key places to update:
| What | Where | Default Pattern |
|---|---|---|
| Catalog names | medallion_bootstrap/config.py | {env}_bronze, {env}_silver, {env}_gold |
| Schema names | medallion_bootstrap/config.py | raw, cleansed, analytics, etc. |
| Storage accounts | config/environment.py | styourorg{env} |
| Secret scope | config/secrets.py | pipeline_secrets |
| Log table | config/logging_config.py | audit.pipeline_logs |
1. Create a new file in ingestion_templates/
2. Extend BasePipeline:
from ingestion_templates.base_pipeline import BasePipeline
class MyCustomPipeline(BasePipeline):
def extract(self) -> DataFrame:
# Your extraction logic
...
def transform(self, df: DataFrame) -> DataFrame:
# Your transformation logic (optional override)
...3. The base class handles Delta table creation, metadata columns, deduplication, and write modes for you.
In config/environment.py, add your workspace org ID to WORKSPACE_ENV_MAP and create a corresponding EnvironmentConfig in the _build_environments() function.
The kit is designed for Azure by default but is adaptable:
abfss:// to s3://, swap Key Vault references for AWS Secrets Manager, use setup_credentials.sql AWS IAM Role templategs://, swap for GCP Secret Manager, use the GCP Service Account credential template| Requirement | Version |
|---|---|
| Databricks Runtime | 13.x or later |
| Python | 3.10+ |
| Unity Catalog | Enabled on workspace |
| Delta Lake | Included with DBR 13.x+ |
azure-identity — For direct Key Vault access (if not using Databricks-backed scopes)requests — For API ingestion pipelines (pre-installed on DBR)databricks-sdk — For deployment scriptsGet the full Databricks Starter Kit and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.