Skip to content

[ISSUE] Issue with databricks_git_credential resource #5301

@Zurina

Description

@Zurina

Hi Databricks,

I am trying to create a Databricks Git Credential using Azure Service Principal federation to Azure Devops. I have followed the federation setup documentation here:

https://learn.microsoft.com/en-us/azure/databricks/repos/automate-with-ms-entra

However, there seem to be a provider issue with the databricks_git_credential resource.

Configuration

terraform {
  required_providers {
    databricks = {
      source  = "databricks/databricks"
      version = "=1.100.0"
    }
  }
}

provider "databricks" {
  host = "https://adb-0000000000000.0.azuredatabricks.net/"
  azure_workspace_resource_id = "/subscriptions/....../resourceGroups/...../providers/Microsoft.Databricks/workspaces/....."
}

resource "databricks_git_credential" "ado" {
  git_provider            = "azureDevOpsServicesAad"
  is_default_for_provider = true
}

resource "databricks_repo" "self_service_app_repo" {
  git_provider = "azureDevOpsServicesAad"
  url          = "https://dev.azure.com/...../..../_git/..."
  path         = "/Repos/...."
  branch       = "main"
  depends_on = [ databricks_git_credential.ado ]
}

The Terraform plan succeeds but the Terraform apply fails. The Terraform plan states this:

# databricks_git_credential.ado will be created
  + resource "databricks_git_credential" "ado" {
      + git_provider            = "azureDevOpsServicesAad"
      + id                      = (known after apply)
      + is_default_for_provider = true
      + personal_access_token   = ***
    }

# databricks_repo.self_service_app_repo will be created
  + resource "databricks_repo" "self_service_app_repo" {
      + branch         = "develop"
      + commit_hash    = (known after apply)
      + git_provider   = "azureDevOpsServicesAad"
      + id             = (known after apply)
      + path           = "/Repos/..."
      + url            = "[https://dev.azure.com/.../.../_git/..."](https://dev.azure.com/.../.../_git/....)
      + workspace_path = (known after apply)
    }

Expected Behavior

Terraform apply succeeds.

Actual Behavior

Terraform apply fails.

Error: Provider produced inconsistent final plan

│ When expanding the plan for databricks_git_credential.ado to include new
│ values learned so far during apply, provider
│ "registry.terraform.io/databricks/databricks" produced an invalid new value
│ for .personal_access_token: was
│ cty.StringVal("***
│ but now
│ cty.StringVal(***

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Terraform and provider versions

databricks/databricks 1.100.0

Terraform version 1.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions