databricks

Deployment Checklist

Purpose: Pre-flight checklist to ensure successful deployment and prevent common issues.

Use this checklist before running terraform apply or terraform destroy.


πŸ“‹ Pre-Deployment Checklist

1. Code Configuration

2. Environment Variables

3. Terraform Configuration

4. Variable Values

5. Pre-Flight Validation


πŸ—‘οΈ Pre-Destroy Checklist

1. Confirm Intention

2. Check Dependencies

3. Destroy Sequence

4. Post-Destroy Cleanup


⚠️ Common Mistakes to Avoid

Code Configuration Mistakes

❌ Setting force_destroy = false or not setting it at all

# DON'T DO THIS
resource "databricks_metastore" "this" {
  force_destroy = false  # ❌ Will block destroy
}

βœ… Always use force_destroy = true

# DO THIS
resource "databricks_metastore" "this" {
  force_destroy = true  # βœ… Allows clean destroy
}

❌ Adding lifecycle.ignore_changes for force_destroy

# DON'T DO THIS
resource "databricks_metastore" "this" {
  force_destroy = true
  lifecycle {
    ignore_changes = [force_destroy]  # ❌ Prevents destroy
  }
}

βœ… No lifecycle ignore for force_destroy

# DO THIS
resource "databricks_metastore" "this" {
  force_destroy = true  # βœ… No lifecycle block
}

❌ Creating NSG rules for Non-PL deployments

# DON'T DO THIS
resource "azurerm_network_security_rule" "example" {
  # This will conflict with Databricks auto-created rules
}

βœ… Conditional NSG rules for Private Link only

# DO THIS
resource "azurerm_network_security_rule" "example" {
  count = var.enable_private_link ? 1 : 0  # βœ… Only for PL
}

❌ Storage account with default_action = "Deny" initially

# DON'T DO THIS
resource "azurerm_storage_account" "example" {
  network_rules {
    default_action = "Deny"  # ❌ Blocks container creation
  }
}

βœ… Allow initial access for container creation

# DO THIS
resource "azurerm_storage_account" "example" {
  network_rules {
    default_action = "Allow"  # βœ… Required initially
  }
}

Environment Mistakes

❌ Missing DATABRICKS_AZURE_TENANT_ID

# DON'T FORGET THIS
export DATABRICKS_AZURE_TENANT_ID="..."  # ❌ Often forgotten

βœ… Always export tenant ID

# DO THIS
export DATABRICKS_AZURE_TENANT_ID="$ARM_TENANT_ID"  # βœ… Required

❌ Running destroy without checking metastore usage

# DON'T DO THIS
terraform destroy -auto-approve  # ❌ May delete shared metastore

βœ… Check metastore dependencies first

# DO THIS
databricks metastores get --metastore-id <id> --account-id <account-id>
# Check if used by other workspaces
terraform destroy -auto-approve

🎯 Success Criteria

Deployment Success

βœ… All resources created without errors βœ… Workspace accessible at returned URL βœ… Unity Catalog metastore assigned βœ… External location created and accessible βœ… NCC attached to workspace (serverless-ready) βœ… Tags applied to all resources βœ… Random suffixes prevent naming conflicts

Verify NCC:

terraform output ncc_id
# Expected: ncc-<id>

terraform output ncc_name
# Expected: <workspace-prefix>-ncc

Post-Deployment (Optional)

⏸️ Enable Serverless Compute:

Destroy Success

βœ… All Azure resources deleted βœ… No orphaned resources remain βœ… Terraform state is clean βœ… (Optional) Metastore deleted if intended βœ… NCC binding removed (or kept for reuse)


πŸ“ž Need Help?

If you encounter issues:

  1. Check Troubleshooting Guide first
  2. Review this checklist for missed steps
  3. Enable debug logging:
    export TF_LOG=DEBUG
    terraform apply 2>&1 | tee debug.log
    
  4. Check checkpoint documents for similar issues
  5. Contact your platform team

Document Version: 1.1 Next Review: Before each major deployment