https://github.com/kchandan/azure-databricks-terraform
Terraform Templates to deploy DR Setup for Azure Databricks
https://github.com/kchandan/azure-databricks-terraform
azure databricks databricks-deploy terraform-module
Last synced: about 1 month ago
JSON representation
Terraform Templates to deploy DR Setup for Azure Databricks
- Host: GitHub
- URL: https://github.com/kchandan/azure-databricks-terraform
- Owner: kchandan
- License: mit
- Created: 2025-06-30T19:45:41.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-03T00:06:32.000Z (12 months ago)
- Last Synced: 2025-07-03T01:20:00.500Z (12 months ago)
- Topics: azure, databricks, databricks-deploy, terraform-module
- Language: HCL
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Azure Databricks DR/BCP Deployment
Goal of this repo is to develop Databricks DR automation based on best practice suggested by various DB articles.

---
DevOps Automation workflow for Multi-region DR

This Terraform configuration deploys:
- A Databricks workspace (Premium tier)
- A VNet with:
- Public and private subnets
- Subnet delegation for Databricks
- NSG (Network Security Group) attachments
- VNet injection for secure Databricks deployment
- Support for Active/Passive DR setup across regions
## ๐ ๏ธ Requirements
- Terraform >= 1.3
- Azure CLI (`az login`)
- Sufficient Azure permissions to create resources
```
az account set --subscription ""
```
## Create resource group
```
az group create \
--name databricks-demo \
--location eastus
```
```
az storage account create \
--name bcrterraformstatefiles \
--resource-group databricks-demo \
--location eastus \
--sku Standard_LRS \
--kind StorageV2 \
--allow-blob-public-access false
az storage account keys list \
--account-name bcrterraformstatefiles \
--resource-group databricks-demo \
--query "[0].value" \
-o tsv
az storage container create \
--name tfstate \
--account-name bcrterraformstatefiles \
--account-key
```
---
## ๐ How to Deploy the Infrastructure
```bash
# Step into the environment folder
cd infra/prod/eastus
# Initialize the Terraform project
terraform init
# Preview what will be created
terraform plan -var-file="terraform.tfvars"
# Apply the infrastructure
terraform apply -var-file="terraform.tfvars"
````
** Wait for 5 minutes before login to the workspace **
---
## How to Deploy the Jobs/Code
```bash
export DATABRICKS_HOST="https://.cloud.databricks.com"
export DATABRICKS_TOKEN=""
cd /apps/dev
terraform init
terraform plan -var-file="terraform.tfvars"
terraform apply --auto-approve -var-file="terraform.tfvars"
```
## ๐งน To Destroy
```bash
terraform destroy -var-file="terraform.tfvars"
```
---
## โ
Outputs
After deployment, you'll get:
* `databricks_host` โ URL to access your Databricks workspace
---
## ๐ Notes
* Adjust the `terraform.tfvars` to match region and resource group for each deployment.
* Use additional folders like `westus` for DR/secondary regions.