You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: 2.0
Updated: 2026-01-31
Status: Production Ready
This document captures all architectural decisions for converting the databricks-bundle-template repository into a reusable Databricks Asset Bundles custom template.
For planned features and future direction, see ROADMAP.md.
1. Executive Summary
Goal
Convert this "real-world example" DABs repository into a reusable custom template that users can initialize via databricks bundle init with an interactive CLI flow.
Key Decisions
Decision
Choice
Rationale
Template Strategy
In-place conversion
Single source of truth, no version drift, easier maintenance
# From repo root
mkdir ../test-generated
databricks bundle init . --output-dir ../test-generated
# Test the generated bundle
cd ../test-generated/<project_name>
databricks bundle validate -t user
databricks bundle deploy -t user
# Cleanup
databricks bundle destroy -t user
cd ../..
rm -rf test-generated
3. User Prompts & Parameters
Prompt Flow
┌─────────────────────────────────────────────────────────────────────────────┐
│ TEMPLATE INITIALIZATION FLOW │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Q1: project_name │
│ "What is your project name?" │
│ Default: my_data_project │
│ Pattern: ^[A-Za-z][A-Za-z0-9_]*$ │
│ │
│ Q2: environment_setup │
│ "How many deployment environments do you need?" │
│ Options: full (user/stage/prod) | minimal (user/stage) │
│ Default: full │
│ │
│ Q3: include_dev_environment [SKIP IF environment_setup = minimal] │
│ "Include a shared development environment (dev)?" │
│ Options: yes | no │
│ Default: no │
│ │
│ Q4: compute_type │
│ "What compute type should resources use?" │
│ Options: classic | serverless | both │
│ Default: classic │
│ │
│ Q5: cloud_provider [SKIP IF compute_type = serverless] │
│ "Which cloud provider are you using?" │
│ Options: azure | aws | gcp │
│ Default: azure │
│ │
│ Q6: workspace_setup │
│ "Workspace topology for your environments?" │
│ Options: single_workspace | multi_workspace │
│ Default: single_workspace │
│ │
│ Q7: uc_catalog_suffix │
│ "What suffix should be used for Unity Catalog names?" │
│ Catalogs: dev_<suffix>, stage_<suffix>, prod_<suffix> (pre-existing) │
│ User target shares dev catalog with per-user schema prefixes │
│ Default: my_domain │
│ │
│ Q8: include_permissions │
│ "Include comprehensive permissions/RBAC configuration?" │
│ Options: yes | no │
│ Default: yes │
│ │
│ Q9: configure_sp_now │
│ "Configure service principal IDs now?" │
│ Options: yes | no (configure later via search-replace) │
│ Default: no │
│ │
│ Q10-12: Service Principal IDs [CONDITIONAL] │
│ dev_service_principal [SKIP IF configure_sp_now=no OR dev not incl.] │
│ stage_service_principal [SKIP IF configure_sp_now=no] │
│ prod_service_principal [SKIP IF configure_sp_now=no OR minimal mode] │
│ Default: "" (empty, uses SP_PLACEHOLDER_<ENV>) │
│ │
│ Q13: include_cicd │
│ "Include CI/CD pipeline configuration?" │
│ Options: yes | no │
│ Default: yes │
│ │
│ Q14: cicd_platform [SKIP IF include_cicd = no] │
│ "Which CI/CD platform?" │
│ Options: azure_devops | github_actions | gitlab │
│ Default: azure_devops │
│ │
│ Q15: default_branch [SKIP IF include_cicd = no] │
│ "What is the default branch for staging deployments?" │
│ Default: main │
│ │
│ Q16: release_branch [SKIP IF include_cicd = no OR minimal mode] │
│ "What is the release branch for production deployments?" │
│ Default: release │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Parameter Reference Table
#
Parameter
Type
Default
Required
Condition
Description
1
project_name
string
-
Yes
-
Bundle name, folder name, resource prefix
2
environment_setup
string
full
Yes
-
full = user+stage+prod; minimal = user+stage
3
include_dev_environment
string
no
Yes
environment_setup = full
Add optional dev target
4
compute_type
string
classic
Yes
-
serverless, classic, or both
5
cloud_provider
string
azure
Yes
compute_type != serverless
For node_type_id selection
6
workspace_setup
string
single_workspace
Yes
-
single_workspace = shared; multi_workspace = separate
7
uc_catalog_suffix
string
my_domain
Yes
-
Suffix for pre-existing env catalogs (e.g., dev_sales, stage_sales)
8
include_permissions
string
yes
Yes
-
Include RBAC (3-4 groups based on env)
9
configure_sp_now
string
no
Yes
-
Configure SPs during init or later
10
dev_service_principal
string
""
No
configure_sp_now = yes AND include_dev = yes
Dev environment SP app ID
11
stage_service_principal
string
""
No
configure_sp_now = yes
Stage environment SP app ID
12
prod_service_principal
string
""
No
configure_sp_now = yes AND environment_setup = full
Prod environment SP app ID
13
include_cicd
string
yes
Yes
-
Include CI/CD pipeline templates
14
cicd_platform
string
azure_devops
Yes
include_cicd = yes
CI/CD platform selection
15
default_branch
string
main
Yes
include_cicd = yes
Branch for staging deployments
16
release_branch
string
release
Yes
include_cicd = yes AND environment_setup = full
Branch for production deployments
Validation Patterns
All choice-based parameters use pattern validation instead of enum (avoids terminal rendering issues with dynamic option pickers).
Parameter
Pattern
Error Message
project_name
^[A-Za-z][A-Za-z0-9_]*$
"Project name must start with a letter and contain only letters, numbers, and underscores"
environment_setup
^(full|minimal)$
"Please enter 'full' or 'minimal'"
include_dev_environment
^(yes|no)$
"Please enter 'yes' or 'no'"
compute_type
^(classic|serverless|both)$
"Please enter 'classic', 'serverless', or 'both'"
cloud_provider
^(azure|aws|gcp)$
"Please enter 'azure', 'aws', or 'gcp'"
workspace_setup
^(single_workspace|multi_workspace)$
"Please enter 'single_workspace' or 'multi_workspace'"
uc_catalog_suffix
^[a-z][a-z0-9_]*$
"Catalog suffix must be lowercase, start with a letter, and contain only letters, numbers, and underscores"
include_permissions
^(yes|no)$
"Please enter 'yes' or 'no'"
configure_sp_now
^(yes|no)$
"Please enter 'yes' or 'no'"
include_cicd
^(yes|no)$
"Please enter 'yes' or 'no'"
cicd_platform
^(azure_devops|github_actions|gitlab)$
"Please enter 'azure_devops', 'github_actions', or 'gitlab'"
4. Conditional Logic Design
Environment Targets
Configuration
Targets Generated
environment_setup = minimal
user, stage
environment_setup = full + include_dev = no
user, stage, prod
environment_setup = full + include_dev = yes
user, dev, stage, prod
Compute Configuration
Condition
Jobs Config
Pipeline Config
compute_type = serverless
environments block only
serverless: true
compute_type = classic
job_clusters block only
serverless: false + clusters block
compute_type = both
Both blocks (classic commented as alt)
serverless: true + commented clusters
Permissions Blocks
Condition
Effect
include_permissions = yes
Include permissions blocks in non-user targets, grants in schemas for non-user targets
include_permissions = no
Omit all permissions and grants blocks; skip SETUP_GROUPS.md generation
Note: The user target never has schema grants or group-based permissions, regardless of include_permissions. This ensures databricks bundle deploy -t user works immediately without creating groups.
Service Principal Configuration
Architecture: Per-environment SPs with user target isolation
Target
SP Required?
Run-As
SP Grants
user
No
Current user
None
dev
For CI/CD
Commented SP
In target override
stage
For CI/CD
SP
In target override
prod
For CI/CD
SP
In target override
Key Design: Base schemas.yml has no SP grants. SP grants are added per-target in databricks.yml schema overrides. This ensures user target works without any SP configuration.
Condition
Effect
configure_sp_now = yes
Prompt for SP IDs, populate in variables.yml
configure_sp_now = no
Leave as SP_PLACEHOLDER_<ENV> with comment for search-replace
Workspace Configuration
Condition
Effect
workspace_setup = single_workspace
All targets use {{workspace_host}} (init-time workspace URL)
workspace_setup = multi_workspace
Non-user targets use ${var.<env>_workspace_host} variables
workspace_setup = multi_workspace + Azure CI/CD
CI/CD includes DATABRICKS_HOST per environment
workspace_setup = multi_workspace + AWS/GCP CI/CD
No change (already has per-env DATABRICKS_HOST)
CI/CD Pipeline Generation
Condition
Effect
include_cicd = yes + cicd_platform = azure_devops
Generate .azure/devops_pipelines/ with pipeline YAML
Skip all CI/CD directories; pipeline files output empty content
Directory skipping is handled by template/update_layout.tmpl using the Go template skip function. Non-selected CI/CD directories (.azure/, .github/) are skipped entirely. GitLab uses a root file (.gitlab-ci.yml) with a template guard that outputs empty content when not selected.
Authentication is cloud-specific within pipeline templates: