<?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 Issue with Service Principal and Grants in Databricks in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/issue-with-service-principal-and-grants-in-databricks/m-p/79217#M7784</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We created a service principal in Databricks as per the documentation &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, when we execute the following SQL query, we are unable to see the service principal:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SHOW GRANTS testservice &lt;/SPAN&gt;&lt;SPAN&gt;ON&lt;/SPAN&gt;&lt;SPAN&gt; METASTORE&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;error:&lt;BR /&gt;&lt;SPAN&gt;[RequestId=564cbcf9-e8b7-476d-a4db-96e6dccb87ad ErrorClass=PRINCIPAL_DOES_NOT_EXIST] Could not find principal with name testservice&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;We believe this might be the reason why we are unable to create an external location and also unable to grant the "CREATE EXTERNAL LOCATION" permission using the following Terraform code:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;resource "databricks_grants" "grant" {&lt;/P&gt;&lt;P&gt;depends_on = [databricks_metastore.this]&lt;/P&gt;&lt;P&gt;&amp;nbsp; metastore = "databricks_metastore.this.id"&lt;/P&gt;&lt;P&gt;&amp;nbsp; grant {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; principal = "testservice"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; privileges = ["CREATE_EXTERNAL_LOCATION","CREATE_CATALOG"]&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Task011 Create external location to be used as root storage by dev catalog&lt;/P&gt;&lt;P&gt;resource "databricks_external_location" "dev_location" {&lt;/P&gt;&lt;P&gt;&amp;nbsp; provider = databricks.Workspace&lt;/P&gt;&lt;P&gt;&amp;nbsp; name = var.external_location_name&lt;/P&gt;&lt;P&gt;&amp;nbsp; #url="abfss://strgconr@demorkstrgac.dfs.core.windows.net"&lt;/P&gt;&lt;P&gt;&amp;nbsp; url = format("abfss://%s@%s.dfs.core.windows.net/",azurerm_storage_container.dev_catalog.name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; module.metastore_and_users.azurerm_storage_account_unity_catalog.name)&lt;/P&gt;&lt;P&gt;&amp;nbsp; credential_name = databricks_storage_credential.external_mi.id&lt;/P&gt;&lt;P&gt;&amp;nbsp; owner &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = var.owner&lt;/P&gt;&lt;P&gt;&amp;nbsp; comment &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "External location used by dev catalog as root storage"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;error: cannot create grants: metastore_id must be empty or equal to the metastore id assigned to the workspace.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you help us understand why the service principal is not appearing in the query results and how we can resolve this issue to create an external location and grant the necessary permissions?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2024 11:16:56 GMT</pubDate>
    <dc:creator>jv_v</dc:creator>
    <dc:date>2024-07-18T11:16:56Z</dc:date>
    <item>
      <title>Issue with Service Principal and Grants in Databricks</title>
      <link>https://community.databricks.com/t5/get-started-discussions/issue-with-service-principal-and-grants-in-databricks/m-p/79217#M7784</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We created a service principal in Databricks as per the documentation &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/admin/users-groups/service-principals" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, when we execute the following SQL query, we are unable to see the service principal:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SHOW GRANTS testservice &lt;/SPAN&gt;&lt;SPAN&gt;ON&lt;/SPAN&gt;&lt;SPAN&gt; METASTORE&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;error:&lt;BR /&gt;&lt;SPAN&gt;[RequestId=564cbcf9-e8b7-476d-a4db-96e6dccb87ad ErrorClass=PRINCIPAL_DOES_NOT_EXIST] Could not find principal with name testservice&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;We believe this might be the reason why we are unable to create an external location and also unable to grant the "CREATE EXTERNAL LOCATION" permission using the following Terraform code:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;resource "databricks_grants" "grant" {&lt;/P&gt;&lt;P&gt;depends_on = [databricks_metastore.this]&lt;/P&gt;&lt;P&gt;&amp;nbsp; metastore = "databricks_metastore.this.id"&lt;/P&gt;&lt;P&gt;&amp;nbsp; grant {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; principal = "testservice"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; privileges = ["CREATE_EXTERNAL_LOCATION","CREATE_CATALOG"]&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Task011 Create external location to be used as root storage by dev catalog&lt;/P&gt;&lt;P&gt;resource "databricks_external_location" "dev_location" {&lt;/P&gt;&lt;P&gt;&amp;nbsp; provider = databricks.Workspace&lt;/P&gt;&lt;P&gt;&amp;nbsp; name = var.external_location_name&lt;/P&gt;&lt;P&gt;&amp;nbsp; #url="abfss://strgconr@demorkstrgac.dfs.core.windows.net"&lt;/P&gt;&lt;P&gt;&amp;nbsp; url = format("abfss://%s@%s.dfs.core.windows.net/",azurerm_storage_container.dev_catalog.name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; module.metastore_and_users.azurerm_storage_account_unity_catalog.name)&lt;/P&gt;&lt;P&gt;&amp;nbsp; credential_name = databricks_storage_credential.external_mi.id&lt;/P&gt;&lt;P&gt;&amp;nbsp; owner &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = var.owner&lt;/P&gt;&lt;P&gt;&amp;nbsp; comment &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = "External location used by dev catalog as root storage"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;error: cannot create grants: metastore_id must be empty or equal to the metastore id assigned to the workspace.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you help us understand why the service principal is not appearing in the query results and how we can resolve this issue to create an external location and grant the necessary permissions?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 11:16:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/issue-with-service-principal-and-grants-in-databricks/m-p/79217#M7784</guid>
      <dc:creator>jv_v</dc:creator>
      <dc:date>2024-07-18T11:16:56Z</dc:date>
    </item>
  </channel>
</rss>

