<?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: Issue Creating Metastore Using Terraform with Service Principal Authentication in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/issue-creating-metastore-using-terraform-with-service-principal/m-p/75358#M1901</link>
    <description>&lt;P&gt;You need to add the provider alias to the databricks_metastore resource, i.e.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;resource "databricks_metastore" "this" {
provider = databricks.azure_account
name = var.metastore_name
storage_root = format("abfss://%s@%s.dfs.core.windows.net/",
azurerm_storage_container.unity_catalog.name,
azurerm_storage_account.unity_catalog.name)
force_destroy = true
owner = var.owner
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2024 15:47:36 GMT</pubDate>
    <dc:creator>jacovangelder</dc:creator>
    <dc:date>2024-06-21T15:47:36Z</dc:date>
    <item>
      <title>Issue Creating Metastore Using Terraform with Service Principal Authentication</title>
      <link>https://community.databricks.com/t5/data-governance/issue-creating-metastore-using-terraform-with-service-principal/m-p/75233#M1899</link>
      <description>&lt;P&gt;I'm encountering an issue when attempting to create a metastore using Terraform with service principal authentication. Below is the error message I receive:&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;"module.metastore_and_users.databricks_metastore.this: error: cannot create metastore: default auth: cannot configure default credentials, please check &lt;A href="https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication" target="_blank"&gt;https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication&lt;/A&gt; to configure credentials for your preferred authentication method"&lt;BR /&gt;&lt;BR /&gt;I've ensured that my service principal is set up correctly and that the necessary permissions are granted. However, the authentication still seems to be failing. I've followed the instructions on the provided documentation link, but the problem persists.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is the relevant portion of my Terraform code:&lt;/P&gt;&lt;P&gt;"&lt;BR /&gt;terraform {&lt;BR /&gt;required providers {&lt;BR /&gt;azurerm = {&lt;BR /&gt;source = "hashicorp/azurerm"&lt;BR /&gt;}&lt;BR /&gt;databricks = {&lt;BR /&gt;source = "databricks/databricks"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;provider "azurerm"{&lt;BR /&gt;skip_provider_registration = true&lt;BR /&gt;features {}&lt;BR /&gt;subscription_id = var.subscription_id&lt;BR /&gt;tenant_id = var.tenant_id&lt;BR /&gt;client_id = var.client_id&lt;BR /&gt;client_secret = var.client_secret&lt;BR /&gt;}&lt;BR /&gt;// Provider for databricks account&lt;BR /&gt;provider "databricks" {&lt;BR /&gt;alias = "azure_account"&lt;BR /&gt;host = "&lt;A href="https://accounts.azuredatabricks.net" target="_blank"&gt;https://accounts.azuredatabricks.net&lt;/A&gt;"&lt;BR /&gt;account_id = var.account_id&lt;BR /&gt;client_id = var.databricks_clientid&lt;BR /&gt;client_secret = var.databricks_clientsecret&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Provider for databricks workspace&lt;BR /&gt;provider "databricks" {&lt;BR /&gt;alias = "Workspace"&lt;BR /&gt;host = local.databricks_workspace_host&lt;BR /&gt;client_id = var.databricks_clientid&lt;BR /&gt;client_secret = var.databricks_clientsecret&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "databricks_metastore" "this" {&lt;BR /&gt;name = var.metastore_name&lt;BR /&gt;storage_root = format("abfss://%s@%s.dfs.core.windows.net/",&lt;BR /&gt;azurerm_storage_container.unity_catalog.name,&lt;BR /&gt;azurerm_storage_account.unity_catalog.name)&lt;BR /&gt;force_destroy = true&lt;BR /&gt;owner = var.owner&lt;BR /&gt;}&lt;BR /&gt;output "output_metastore" {&lt;BR /&gt;value = databricks_metastore.this.metastore_id&lt;BR /&gt;}&lt;BR /&gt;"&lt;/P&gt;&lt;P&gt;Could anyone help me identify what might be going wrong or provide any suggestions on how to resolve this authentication issue?&lt;/P&gt;&lt;P&gt;Thank you in advance for your assistance!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 16:29:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/issue-creating-metastore-using-terraform-with-service-principal/m-p/75233#M1899</guid>
      <dc:creator>jv_v</dc:creator>
      <dc:date>2024-06-20T16:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Creating Metastore Using Terraform with Service Principal Authentication</title>
      <link>https://community.databricks.com/t5/data-governance/issue-creating-metastore-using-terraform-with-service-principal/m-p/75263#M1900</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/105086"&gt;@jv_v&lt;/a&gt;&amp;nbsp;Since you're using two providers (one on account level, second on workspace level), make sure to specify the provider when trying to create a resource.&lt;BR /&gt;&lt;A href="https://registry.terraform.io/providers/databricks/databricks/latest/docs#authentication" target="_blank"&gt;https://registry.terraform.io/providers/databricks/databricks/latest/docs#authentication&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 06:29:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/issue-creating-metastore-using-terraform-with-service-principal/m-p/75263#M1900</guid>
      <dc:creator>daniel_sahal</dc:creator>
      <dc:date>2024-06-21T06:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Creating Metastore Using Terraform with Service Principal Authentication</title>
      <link>https://community.databricks.com/t5/data-governance/issue-creating-metastore-using-terraform-with-service-principal/m-p/75358#M1901</link>
      <description>&lt;P&gt;You need to add the provider alias to the databricks_metastore resource, i.e.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;resource "databricks_metastore" "this" {
provider = databricks.azure_account
name = var.metastore_name
storage_root = format("abfss://%s@%s.dfs.core.windows.net/",
azurerm_storage_container.unity_catalog.name,
azurerm_storage_account.unity_catalog.name)
force_destroy = true
owner = var.owner
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 15:47:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/issue-creating-metastore-using-terraform-with-service-principal/m-p/75358#M1901</guid>
      <dc:creator>jacovangelder</dc:creator>
      <dc:date>2024-06-21T15:47:36Z</dc:date>
    </item>
  </channel>
</rss>

