Azure — Terraform
You'll deploy a Databricks workspace with VNet injection on Azure using Terraform in ~20 min.
Prereqs: Azure subscription, Terraform CLI, Databricks account console
What you'll build
A Databricks workspace deployed into your Azure subscription with VNet injection. The Terraform template handles the managed resource group, VNet, subnets, NSG rules, and workspace configuration.
Prerequisites
- An Azure subscription with Contributor permissions.
- A Databricks account with account-admin privileges.
- Terraform CLI installed locally.
- Azure CLI authenticated (
az login).
Steps
1. Deploy the workspace
- Go to the template repository: Azure VNet Injection Workspace Setup Guide.
- Follow the README.md instructions.
- Copy
tf/terraform.tfvars.exampleand fill in your values — subscription ID, resource group, region, and workspace name. - Run
terraform init && terraform apply. - Repeat for staging and production workspaces.
2. Video walkthrough (optional)
The video below is a good reference but uses an older version of the template. The steps are similar.
The video references a deprecated version of the Terraform template. Use the repository linked in Step 1 for the current version.
Verify
- Log in to the Databricks account console.
- Navigate to Workspaces and confirm the new workspace shows a Running status.
- In the Azure portal, verify the managed resource group was created with the expected VNet and NSG resources.
Troubleshoot
Terraform apply fails with permission errors
Confirm the Azure CLI is authenticated with a principal that has Contributor access on the target subscription. Run az account show to verify the active subscription.
VNet injection fails with subnet errors
The subnets must be delegated to Microsoft.Databricks/workspaces and must not overlap with existing address spaces. Check the template's subnet CIDR values against your existing network layout.
Next
- Do next: Add Users
- Learn why: Unity Catalog foundations
- Reference: Databricks Terraform provider