<?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: Understanding the Use of a Specific Terraform Block in Unity Catalog Automation in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/understanding-the-use-of-a-specific-terraform-block-in-unity/m-p/75952#M1919</link>
    <description>&lt;P&gt;I implemented the following Terraform code for configuring a Databricks metastore data access:&lt;/P&gt;&lt;P&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;BR /&gt;}&lt;/P&gt;&lt;P&gt;provider "azurerm"{&lt;BR /&gt;alias = "azure"&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;/P&gt;&lt;P&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;#auth_type = "azure-cli"&lt;BR /&gt;client_id = var.client_id&lt;BR /&gt;client_secret = var.db_client_secret&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.client_id&lt;BR /&gt;client_secret = var.db_client_secret&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Task: Create the first unity catalog metastore&lt;BR /&gt;resource "databricks_metastore" "this" {&lt;BR /&gt;provider = databricks.azure_account&lt;BR /&gt;name = var.metastore_name&lt;BR /&gt;region = var.use_existing_resource_group ? data.azurerm_resource_group.existing[0].location : azurerm_resource_group.new[0].location&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;// Task : Attach the databricks workspace to the metastore&lt;BR /&gt;resource "databricks_metastore_assignment" "this" {&lt;BR /&gt;provider = databricks.Workspace&lt;BR /&gt;workspace_id = local.databricks_workspace_id&lt;BR /&gt;metastore_id = databricks_metastore.this.id&lt;BR /&gt;default_catalog_name = var.default_catalog_name&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//Task :Assign managed identity to metastore&lt;BR /&gt;resource "databricks_metastore_data_access" "first" {&lt;BR /&gt;provider = databricks.azure_account&lt;BR /&gt;metastore_id = databricks_metastore.this.id&lt;BR /&gt;name = "the-metastore-key"&lt;BR /&gt;azure_managed_identity {&lt;BR /&gt;access_connector_id = azurerm_databricks_access_connector.unity.id&lt;BR /&gt;}&lt;BR /&gt;is_default = true&lt;BR /&gt;depends_on = [databricks_metastore_assignment.this]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;output "metastore_data_access_details" {&lt;BR /&gt;value = {&lt;BR /&gt;metastore_id = databricks_metastore_data_access.first.id&lt;BR /&gt;access_connector_id = databricks_metastore_data_access.first.azure_managed_identity&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;However, I'm encountering the following error when executing this code:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"databricks_metastore_data_access.first"&lt;/SPAN&gt; &lt;SPAN&gt;error:&lt;/SPAN&gt;&lt;SPAN&gt; cannot create metastore data access: User does not have CREATE EXTERNAL LOCATION on Metastore"&lt;BR /&gt;&lt;BR /&gt;Any insights or suggestions to resolve this issue would be greatly appreciated!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 27 Jun 2024 14:34:30 GMT</pubDate>
    <dc:creator>jv_v</dc:creator>
    <dc:date>2024-06-27T14:34:30Z</dc:date>
    <item>
      <title>Understanding the Use of a Specific Terraform Block in Unity Catalog Automation</title>
      <link>https://community.databricks.com/t5/data-governance/understanding-the-use-of-a-specific-terraform-block-in-unity/m-p/75671#M1909</link>
      <description>&lt;P&gt;I am currently working on automating Unity Catalog (UC) using Terraform, and I came across the following Terraform block:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resource&lt;/SPAN&gt; &lt;SPAN&gt;"databricks_metastore_data_access"&lt;/SPAN&gt; &lt;SPAN&gt;"first"&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;provider&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;databricks&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Workspace&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;metastore_id&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;databricks_metastore&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"the-metastore-key"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;azure_managed_identity&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;access_connector_id&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;azurerm_databricks_access_connector&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;unity&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;is_default&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;true&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;depends_on&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;databricks_metastore_assignment&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;I have a few questions regarding the use of this block:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Purpose and Functionality&lt;/STRONG&gt;: Could you explain the purpose and functionality of this specific Terraform block in the context of Unity Catalog automation? How does it contribute to the overall automation process?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Mandatory or Optional&lt;/STRONG&gt;: Is it mandatory to include this Terraform block in my UC automation scripts? What could be the consequences or limitations if I choose not to use it?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Provider Usage&lt;/STRONG&gt;: For this block, can I use both the Databricks account-level provider and the Databricks workspace-level provider? Are there any specific scenarios or best practices where one is preferred over the other?Any insights or experiences shared would be greatly appreciated!&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Jun 2024 07:42:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/understanding-the-use-of-a-specific-terraform-block-in-unity/m-p/75671#M1909</guid>
      <dc:creator>jv_v</dc:creator>
      <dc:date>2024-06-25T07:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the Use of a Specific Terraform Block in Unity Catalog Automation</title>
      <link>https://community.databricks.com/t5/data-governance/understanding-the-use-of-a-specific-terraform-block-in-unity/m-p/75695#M1910</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The terraform block you've shared defines authentication methods for accessing cloud storage used as the default location for the metastore. While optional, not defining it means you won't be able to utilize the default storage location for your metastore (which serves as the default location for catalogs, schemas, and tables unless a storage location is specified at any level below the metastore one).&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope this addresses your initial two questions. Regarding the third, a brief answer is yes, you can use either the account-level or workspace-level provider. In my preference, I lean towards the account-level provider since it isn't specifically tied to workspace resources.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For further documentation I suggest to visit&amp;nbsp;&lt;A href="https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/metastore_data_access" target="_blank"&gt;https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/metastore_data_access&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 11:09:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/understanding-the-use-of-a-specific-terraform-block-in-unity/m-p/75695#M1910</guid>
      <dc:creator>giuseppegrieco</dc:creator>
      <dc:date>2024-06-25T11:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the Use of a Specific Terraform Block in Unity Catalog Automation</title>
      <link>https://community.databricks.com/t5/data-governance/understanding-the-use-of-a-specific-terraform-block-in-unity/m-p/75952#M1919</link>
      <description>&lt;P&gt;I implemented the following Terraform code for configuring a Databricks metastore data access:&lt;/P&gt;&lt;P&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;BR /&gt;}&lt;/P&gt;&lt;P&gt;provider "azurerm"{&lt;BR /&gt;alias = "azure"&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;/P&gt;&lt;P&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;#auth_type = "azure-cli"&lt;BR /&gt;client_id = var.client_id&lt;BR /&gt;client_secret = var.db_client_secret&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.client_id&lt;BR /&gt;client_secret = var.db_client_secret&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Task: Create the first unity catalog metastore&lt;BR /&gt;resource "databricks_metastore" "this" {&lt;BR /&gt;provider = databricks.azure_account&lt;BR /&gt;name = var.metastore_name&lt;BR /&gt;region = var.use_existing_resource_group ? data.azurerm_resource_group.existing[0].location : azurerm_resource_group.new[0].location&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;// Task : Attach the databricks workspace to the metastore&lt;BR /&gt;resource "databricks_metastore_assignment" "this" {&lt;BR /&gt;provider = databricks.Workspace&lt;BR /&gt;workspace_id = local.databricks_workspace_id&lt;BR /&gt;metastore_id = databricks_metastore.this.id&lt;BR /&gt;default_catalog_name = var.default_catalog_name&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//Task :Assign managed identity to metastore&lt;BR /&gt;resource "databricks_metastore_data_access" "first" {&lt;BR /&gt;provider = databricks.azure_account&lt;BR /&gt;metastore_id = databricks_metastore.this.id&lt;BR /&gt;name = "the-metastore-key"&lt;BR /&gt;azure_managed_identity {&lt;BR /&gt;access_connector_id = azurerm_databricks_access_connector.unity.id&lt;BR /&gt;}&lt;BR /&gt;is_default = true&lt;BR /&gt;depends_on = [databricks_metastore_assignment.this]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;output "metastore_data_access_details" {&lt;BR /&gt;value = {&lt;BR /&gt;metastore_id = databricks_metastore_data_access.first.id&lt;BR /&gt;access_connector_id = databricks_metastore_data_access.first.azure_managed_identity&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;However, I'm encountering the following error when executing this code:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"databricks_metastore_data_access.first"&lt;/SPAN&gt; &lt;SPAN&gt;error:&lt;/SPAN&gt;&lt;SPAN&gt; cannot create metastore data access: User does not have CREATE EXTERNAL LOCATION on Metastore"&lt;BR /&gt;&lt;BR /&gt;Any insights or suggestions to resolve this issue would be greatly appreciated!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jun 2024 14:34:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/understanding-the-use-of-a-specific-terraform-block-in-unity/m-p/75952#M1919</guid>
      <dc:creator>jv_v</dc:creator>
      <dc:date>2024-06-27T14:34:30Z</dc:date>
    </item>
  </channel>
</rss>

