<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best place to manage terraform-provider-databricks and databricks cli in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/best-place-to-manage-terraform-provider-databricks-and/m-p/146437#M52652</link>
    <description>&lt;P&gt;Hi Ajay,&lt;/P&gt;&lt;P&gt;This is something that you could set-up using any provider that supports CI/CD pipelines that you can install and run Databricks CLI commands on (e.g GitHub Actions, Azure DevOps, and so on) Historically, I have used Azure DevOps to drive this between Databricks and the IAC repository, but the pattern should remain the same regardless of what provider you use. ( Here is a great blog from Microsoft that sums up one approach:&amp;nbsp;&lt;A href="https://techcommunity.microsoft.com/blog/azureinfrastructureblog/deploy-and-manage-azure-databricks-infrastructure-using-terraform-and-azure-devo/4413774" target="_self"&gt;Deploy and Manage Azure Databricks Infrastructure using Terraform and Azure Devops pipeline )&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If your use case permits it, I would recommend using &lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/" target="_self"&gt;Databricks Asset Bundles&lt;/A&gt; over using Terraform provider as this will open up more deployment options and provide the to deploy IaC from Databricks Workspace UI.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Feb 2026 00:31:12 GMT</pubDate>
    <dc:creator>Marc_Gibson96</dc:creator>
    <dc:date>2026-02-02T00:31:12Z</dc:date>
    <item>
      <title>Best place to manage terraform-provider-databricks and databricks cli</title>
      <link>https://community.databricks.com/t5/data-engineering/best-place-to-manage-terraform-provider-databricks-and/m-p/145581#M52536</link>
      <description>&lt;P&gt;I am trying to export and import files using&amp;nbsp;terraform-provider-databricks and databricks cli. I am figuring out on how to manage the files without being running in local. whats the best practice to setup such migration. Can anyone help in established process for this.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jan 2026 16:39:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/best-place-to-manage-terraform-provider-databricks-and/m-p/145581#M52536</guid>
      <dc:creator>ajay_wavicle</dc:creator>
      <dc:date>2026-01-28T16:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Best place to manage terraform-provider-databricks and databricks cli</title>
      <link>https://community.databricks.com/t5/data-engineering/best-place-to-manage-terraform-provider-databricks-and/m-p/146437#M52652</link>
      <description>&lt;P&gt;Hi Ajay,&lt;/P&gt;&lt;P&gt;This is something that you could set-up using any provider that supports CI/CD pipelines that you can install and run Databricks CLI commands on (e.g GitHub Actions, Azure DevOps, and so on) Historically, I have used Azure DevOps to drive this between Databricks and the IAC repository, but the pattern should remain the same regardless of what provider you use. ( Here is a great blog from Microsoft that sums up one approach:&amp;nbsp;&lt;A href="https://techcommunity.microsoft.com/blog/azureinfrastructureblog/deploy-and-manage-azure-databricks-infrastructure-using-terraform-and-azure-devo/4413774" target="_self"&gt;Deploy and Manage Azure Databricks Infrastructure using Terraform and Azure Devops pipeline )&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If your use case permits it, I would recommend using &lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/" target="_self"&gt;Databricks Asset Bundles&lt;/A&gt; over using Terraform provider as this will open up more deployment options and provide the to deploy IaC from Databricks Workspace UI.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 00:31:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/best-place-to-manage-terraform-provider-databricks-and/m-p/146437#M52652</guid>
      <dc:creator>Marc_Gibson96</dc:creator>
      <dc:date>2026-02-02T00:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Best place to manage terraform-provider-databricks and databricks cli</title>
      <link>https://community.databricks.com/t5/data-engineering/best-place-to-manage-terraform-provider-databricks-and/m-p/150168#M53283</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/210036"&gt;@ajay_wavicle&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;There are a couple of well-established patterns for managing Databricks resources with the Terraform provider and CLI without running everything locally. Here is a breakdown of the options and recommended approach.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;WHERE TO RUN TERRAFORM AND THE DATABRICKS CLI&lt;/P&gt;
&lt;P&gt;The key is to move execution into a CI/CD pipeline so that no one needs to run terraform apply or databricks CLI commands from their laptop. The most common options:&lt;/P&gt;
&lt;P&gt;1. GitHub Actions&lt;BR /&gt;2. Azure DevOps Pipelines&lt;BR /&gt;3. GitLab CI/CD&lt;BR /&gt;4. Jenkins&lt;/P&gt;
&lt;P&gt;In each case, the pipeline runner installs both the Terraform CLI and the Databricks CLI, authenticates using a service principal, and executes the commands on your behalf.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;AUTHENTICATION FOR AUTOMATED PIPELINES&lt;/P&gt;
&lt;P&gt;For CI/CD, use OAuth machine-to-machine (M2M) authentication with a Databricks service principal. This avoids personal access tokens and keeps credentials scoped and rotatable.&lt;/P&gt;
&lt;P&gt;You will need:&lt;BR /&gt;- A Databricks service principal with the appropriate workspace permissions&lt;BR /&gt;- The client ID and client secret stored as pipeline secrets (not in code)&lt;BR /&gt;- Environment variables set in the pipeline:&lt;/P&gt;
&lt;P&gt;export DATABRICKS_HOST="&lt;A href="https://your-workspace.cloud.databricks.com" target="_blank"&gt;https://your-workspace.cloud.databricks.com&lt;/A&gt;"&lt;BR /&gt;export DATABRICKS_CLIENT_ID="&amp;lt;your-sp-client-id&amp;gt;"&lt;BR /&gt;export DATABRICKS_CLIENT_SECRET="&amp;lt;your-sp-client-secret&amp;gt;"&lt;/P&gt;
&lt;P&gt;The Terraform provider picks these up automatically:&lt;/P&gt;
&lt;P&gt;provider "databricks" {&lt;BR /&gt;# No hardcoded credentials needed; uses env vars&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;Docs: &lt;A href="https://docs.databricks.com/aws/en/dev-tools/auth/index.html" target="_blank"&gt;https://docs.databricks.com/aws/en/dev-tools/auth/index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;TERRAFORM PROVIDER SETUP&lt;/P&gt;
&lt;P&gt;1. Store your .tf files in a Git repository.&lt;BR /&gt;2. Use a remote backend for Terraform state (S3 + DynamoDB for AWS, Azure Blob Storage for Azure, or Terraform Cloud/HCP). This way, state is shared across the team and pipeline runs, not on anyone's local machine.&lt;BR /&gt;3. Structure your repo with modules for reusable components.&lt;/P&gt;
&lt;P&gt;Example project layout:&lt;/P&gt;
&lt;P&gt;my-databricks-infra/&lt;BR /&gt;main.tf&lt;BR /&gt;variables.tf&lt;BR /&gt;outputs.tf&lt;BR /&gt;modules/&lt;BR /&gt;workspace-config/&lt;BR /&gt;main.tf&lt;BR /&gt;unity-catalog/&lt;BR /&gt;main.tf&lt;BR /&gt;environments/&lt;BR /&gt;dev.tfvars&lt;BR /&gt;staging.tfvars&lt;BR /&gt;prod.tfvars&lt;/P&gt;
&lt;P&gt;A minimal main.tf:&lt;/P&gt;
&lt;P&gt;terraform {&lt;BR /&gt;required_providers {&lt;BR /&gt;databricks = {&lt;BR /&gt;source = "databricks/databricks"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;backend "s3" {&lt;BR /&gt;bucket = "my-terraform-state"&lt;BR /&gt;key = "databricks/terraform.tfstate"&lt;BR /&gt;region = "us-east-1"&lt;BR /&gt;dynamodb_table = "terraform-lock"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;provider "databricks" {}&lt;/P&gt;
&lt;P&gt;Databricks maintains an examples repository with CI/CD patterns for GitHub Actions and Azure DevOps:&lt;BR /&gt;&lt;A href="https://github.com/databricks/terraform-databricks-examples" target="_blank"&gt;https://github.com/databricks/terraform-databricks-examples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Look at the "manual-approve-with-github-actions" and "manual-approve-with-azure-devops" folders for ready-to-use pipeline templates.&lt;/P&gt;
&lt;P&gt;Provider registry docs: &lt;A href="https://registry.terraform.io/providers/databricks/databricks/latest/docs" target="_blank"&gt;https://registry.terraform.io/providers/databricks/databricks/latest/docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;DATABRICKS CLI IN CI/CD&lt;/P&gt;
&lt;P&gt;Install the CLI in your pipeline with:&lt;/P&gt;
&lt;P&gt;curl -fsSL &lt;A href="https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh" target="_blank"&gt;https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh&lt;/A&gt; | sh&lt;/P&gt;
&lt;P&gt;Then use it for file operations, workspace sync, or running bundle commands. The same environment variables (DATABRICKS_HOST, DATABRICKS_CLIENT_ID, DATABRICKS_CLIENT_SECRET) authenticate the CLI automatically.&lt;/P&gt;
&lt;P&gt;For file export/import specifically:&lt;/P&gt;
&lt;P&gt;# Export a notebook&lt;BR /&gt;databricks workspace export /Users/someone/notebook.py ./local-copy.py&lt;/P&gt;
&lt;P&gt;# Import a notebook&lt;BR /&gt;databricks workspace import ./local-copy.py /Users/someone/notebook.py&lt;/P&gt;
&lt;P&gt;# Sync a local directory to the workspace&lt;BR /&gt;databricks sync ./src /Workspace/Users/someone/project --watch=false&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;RECOMMENDED APPROACH: DATABRICKS ASSET BUNDLES&lt;/P&gt;
&lt;P&gt;If your goal is to manage and migrate Databricks resources (jobs, notebooks, pipelines) across environments, consider Databricks Asset Bundles (DABs). They combine the best of both worlds: you define resources as YAML configuration files in Git, and the Databricks CLI handles deployment.&lt;/P&gt;
&lt;P&gt;DABs support:&lt;BR /&gt;- Multi-environment promotion (dev, staging, prod) through "targets"&lt;BR /&gt;- Service principal authentication for CI/CD&lt;BR /&gt;- Automatic resource naming and isolation in dev mode&lt;BR /&gt;- GitHub Actions integration for automated deployments&lt;/P&gt;
&lt;P&gt;A quick example of a databricks.yml:&lt;/P&gt;
&lt;P&gt;bundle:&lt;BR /&gt;name: my_project&lt;/P&gt;
&lt;P&gt;targets:&lt;BR /&gt;dev:&lt;BR /&gt;mode: development&lt;BR /&gt;default: true&lt;BR /&gt;workspace:&lt;BR /&gt;host: &lt;A href="https://dev-workspace.cloud.databricks.com" target="_blank"&gt;https://dev-workspace.cloud.databricks.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;prod:&lt;BR /&gt;mode: production&lt;BR /&gt;workspace:&lt;BR /&gt;host: &lt;A href="https://prod-workspace.cloud.databricks.com" target="_blank"&gt;https://prod-workspace.cloud.databricks.com&lt;/A&gt;&lt;BR /&gt;run_as:&lt;BR /&gt;service_principal_name: prod-deployer@company.com&lt;/P&gt;
&lt;P&gt;Deploy with:&lt;/P&gt;
&lt;P&gt;databricks bundle deploy --target prod&lt;/P&gt;
&lt;P&gt;Docs: &lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/index.html" target="_blank"&gt;https://docs.databricks.com/aws/en/dev-tools/bundles/index.html&lt;/A&gt;&lt;BR /&gt;Deployment modes: &lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/deployment-modes.html" target="_blank"&gt;https://docs.databricks.com/aws/en/dev-tools/bundles/deployment-modes.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;WHEN TO USE TERRAFORM VS. ASSET BUNDLES&lt;/P&gt;
&lt;P&gt;- Use the Terraform provider for workspace-level infrastructure: creating workspaces, configuring Unity Catalog, managing IAM roles, setting up networking, and provisioning cloud resources.&lt;BR /&gt;- Use Databricks Asset Bundles for application-level resources: deploying jobs, notebooks, pipelines, and ML experiments across environments.&lt;BR /&gt;- Many teams use both: Terraform for the "platform layer" and DABs for the "application layer."&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SAMPLE GITHUB ACTIONS WORKFLOW&lt;/P&gt;
&lt;P&gt;Here is a simplified GitHub Actions workflow that runs Terraform without any local execution:&lt;/P&gt;
&lt;P&gt;name: Deploy Databricks Infra&lt;BR /&gt;on:&lt;BR /&gt;push:&lt;BR /&gt;branches: [main]&lt;/P&gt;
&lt;P&gt;jobs:&lt;BR /&gt;deploy:&lt;BR /&gt;runs-on: ubuntu-latest&lt;BR /&gt;env:&lt;BR /&gt;DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}&lt;BR /&gt;DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }}&lt;BR /&gt;DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }}&lt;/P&gt;
&lt;P&gt;steps:&lt;BR /&gt;- uses: actions/checkout@v4&lt;/P&gt;
&lt;P&gt;- uses: hashicorp/setup-terraform@v3&lt;BR /&gt;with:&lt;BR /&gt;terraform_version: 1.9.0&lt;/P&gt;
&lt;P&gt;- run: terraform init&lt;BR /&gt;- run: terraform plan -var-file=environments/prod.tfvars&lt;BR /&gt;- run: terraform apply -auto-approve -var-file=environments/prod.tfvars&lt;/P&gt;
&lt;P&gt;This keeps everything in version control and running in the cloud, with no local execution required.&lt;/P&gt;
&lt;P&gt;Hope this helps you get set up. Let me know if you have follow-up questions about any of these patterns.&lt;/P&gt;
&lt;P&gt;* This reply used an agent system I built to research and draft this response based on the wide set of documentation I have available and previous memory. I personally review the draft for any obvious issues and for monitoring system reliability and update it when I detect any drift, but there is still a small chance that something is inaccurate, especially if you are experimenting with brand new features.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2026 07:22:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/best-place-to-manage-terraform-provider-databricks-and/m-p/150168#M53283</guid>
      <dc:creator>SteveOstrowski</dc:creator>
      <dc:date>2026-03-08T07:22:15Z</dc:date>
    </item>
  </channel>
</rss>

