cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Governance
Join discussions on data governance practices, compliance, and security within the Databricks Community. Exchange strategies and insights to ensure data integrity and regulatory compliance.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Error with databricks_storage_credential resource

JustLeo
New Contributor III

Hello all, I having an issue which after trying different things, still not able to find the root cause of the problem.
I have my Teraform databrick provider configure like this:

Databricks provider version= v1.49.1

provider "databricks" {
host = module.databricks.databricks.workspace_url
}

and then my "databricks_storage_credential" resource looks like this:

resource "databricks_storage_credential" "external" {
    name = azurerm_databricks_access_connector.unity.name
    azure_managed_identity {
        access_connector_id = azurerm_databricks_access_connector.unity.id
     }
   isolation_mode = "ISOLATION_MODE_ISOLATED"
   comment = "Managed by TF"
}

I have no problem with provisioning or destruction. I can even deploy later a cluster within Databricks workspace, but on certain updates, like tag update or adding a new RG, I'm getting below error:

Error: cannot read storage credential: failed during request visitor: default auth: cannot configure default credentials, please check https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication to configure credentials for your preferred authentication method. Config: azure_client_secret=***, azure_client_id=<CLIENT_ID>, azure_tenant_id=<TENANT_ID>. Env: ARM_CLIENT_SECRET, ARM_CLIENT_ID, ARM_TENANT_ID
โ”‚
โ”‚ with module.databricks.databricks_storage_credential.external,
โ”‚ on modules/terraform-azurerm-databricks-workspace/main.tf line 191, in resource "databricks_storage_credential" "external":
โ”‚ 191: resource "databricks_storage_credential" "external" {

Looks to me that I'm missing some read permission somewhere. Any advise? Any help will be more than welcome ๐Ÿ™‚
Thanks in advance...

1 ACCEPTED SOLUTION

Accepted Solutions

JustLeo
New Contributor III

Solution to this issue:
Instead of configuring the provider like this:

provider "databricks" {

   host = module.databricks.databricks.workspace_url
}

first save the value in a local and use it in the provider, like this:
locals {
   my_url = module.databricks.databricks.workspace_url
}
provider "databricks" {
   host = local.my_url
}

 

View solution in original post

2 REPLIES 2

Kaniz_Fatma
Community Manager
Community Manager

Hi @JustLeo, It looks like your default authentication method is having a bit of a meltdown. Hereโ€™s the game plan: First, make sure the managed identity is properly assigned to your Databricks workspace and has all the permissions it needs. Next, double-check the access_connector_id to confirm it's pointing to the right resource. Think of it as making sure your keys fit the right door and that youโ€™ve got the right keychain for the job.

JustLeo
New Contributor III

Solution to this issue:
Instead of configuring the provider like this:

provider "databricks" {

   host = module.databricks.databricks.workspace_url
}

first save the value in a local and use it in the provider, like this:
locals {
   my_url = module.databricks.databricks.workspace_url
}
provider "databricks" {
   host = local.my_url
}

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group