Skip to main content

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

  1. Go to the template repository: Azure VNet Injection Workspace Setup Guide.
  2. Follow the README.md instructions.
  3. Copy tf/terraform.tfvars.example and fill in your values — subscription ID, resource group, region, and workspace name.
  4. Run terraform init && terraform apply.
  5. 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.

warning

The video references a deprecated version of the Terraform template. Use the repository linked in Step 1 for the current version.

Verify

  1. Log in to the Databricks account console.
  2. Navigate to Workspaces and confirm the new workspace shows a Running status.
  3. 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