Integrate Gitlab Repos to Azure Databricks workspace

I have configured Azure Databricks workspace and trying to integrate it with Gitlab to add repos using terraform.
I have added Gitlab personal access token to the databricks provider but seeingthe error “authentication is not configured for provider”.

Error: authentication is not configured for provider… Environment variables used: ARM_SUBSCRIPTION_ID, ARM_CLIENT_SECRET, ARM_CLIENT_ID, ARM_TENANT_ID. Please check https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs#authentication for details

│ with databricks_repo.databricks-ws,
│ on main.tf line , in resource “databricks_repo” “databricks-ws”:
│ : resource “databricks_repo” “databricks-ws” {

I tried without adding the Gitlab access token, still getting the same error.
Is there a way to set up authentication to databricks for Gitlab Repo Integration?

##main.tf
resource “azurerm_databricks_workspace” “databricks-ws” {
name = “databricks-ws”
resource_group_name = azurerm_resource_group.databricks.name
location = azurerm_resource_group.databricks.location
sku = premium
managed_resource_group_name = “${local.resource_group_name}-managed”

custom_parameters {
public_subnet_name = data.azurerm_subnet.snet-host.name
public_subnet_network_security_group_association_id = data.azurerm_subnet.snet-host.id
private_subnet_name = data.azurerm_subnet.snet-container.name
private_subnet_network_security_group_association_id = data.azurerm_subnet.snet-container.id
virtual_network_id = data.azurerm_virtual_network.vnet.id
}
}

resource “databricks_repo” “databricks-ws” {
url = “https://gitlab.com/abc/xyz/notebooks.git
git_provider = “gitLab”
branch = “test”
}

##provider.tf

provider “databricks” {
alias = “databricks_provider”
host = data.azurerm_databricks_workspace.databricks-ws.workspace_url
token = var.databricks_pat #gitlab personal access token
}

## data.tf
data “azurerm_databricks_workspace” “databricks-ws” {
name = “databricks-ws”
resource_group_name = local.resource_group_name
}

## Error Message

Error: authentication is not configured for provider… Environment variables used: ARM_SUBSCRIPTION_ID, ARM_CLIENT_SECRET, ARM_CLIENT_ID, ARM_TENANT_ID. Please check https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs#authentication for details

│ with databricks_repo.databricks-ws,
│ on main.tf line 164, in resource “databricks_repo” “databricks-ws”:
│ : resource “databricks_repo” “databricks-ws” {

  1. You must add azure_workspace_resource_id attribute to databricks provider definition, as you’re working with SPN.
  2. you don’t need to specify token argument to databricks provider, as you’re already have SPN credentials in environment variables (ARM_CLIENT_ID, ARM_TENANT_ID, and ARM_CLIENT_SECRET). GitLab token has nothing to do with configuring Databricks provider.

At the time of this writing, you still have to manually configure gitlab PAT from Databricks workspace UI, until the API for GIT provider registration is built.

Also use ARM_USE_MSI to configure everything with Managed Service Identity, which is way more secure and doesn’t require secrets.