<?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: Problem with Metastore in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/137600#M4381</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/188657"&gt;@jzu&lt;/a&gt;&amp;nbsp;, is this a new error or is it the same as before. I need more details please. Louis.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Nov 2025 16:26:34 GMT</pubDate>
    <dc:creator>Louis_Frolio</dc:creator>
    <dc:date>2025-11-04T16:26:34Z</dc:date>
    <item>
      <title>Problem with Metastore</title>
      <link>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/133713#M4149</link>
      <description>&lt;P&gt;Hello community.&lt;/P&gt;&lt;P&gt;We are facing an issue when deploying and configuring metastore using terraform.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using Azure Devops pipeline for deployment. The identity running the pipeline is a managed identity and it's set as account admin in Account portal.&lt;/P&gt;&lt;P&gt;When we run the pipeline first time everything is created successfully. However after some time, without any change to the code, we run the very same pipeline with following error:&amp;nbsp;&lt;SPAN class=""&gt;Error: &lt;/SPAN&gt;&lt;SPAN class=""&gt;cannot read metastore: User not authorized.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If I remove the metastore and create it again with the very same pipeline, it's successfully created. Even immediate pipeline runs are successful, after some time however we again get the error above. Is there any additional configuration required except what we have?&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;provider&lt;/SPAN&gt; &lt;SPAN&gt;"databricks"&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;alias&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"accounts"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;host&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;A href="https://accounts.azuredatabricks.net" target="_blank" rel="noopener"&gt;https://accounts.azuredatabricks.net&lt;/A&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;account_id&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;local&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;account_id&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resource&lt;/SPAN&gt; &lt;SPAN&gt;"databricks_metastore"&lt;/SPAN&gt; &lt;SPAN&gt;"metastore"&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;name&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;metastore_name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;region&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;location&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;owner&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;metastore_owner&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;accounts&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Any help is highly appreciated.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Jozef&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 15:02:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/133713#M4149</guid>
      <dc:creator>jzu</dc:creator>
      <dc:date>2025-10-03T15:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Metastore</title>
      <link>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/133719#M4150</link>
      <description>&lt;P&gt;Greetings&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/188657"&gt;@jzu&lt;/a&gt;&amp;nbsp;, I did some digging around with internal docs and references and put together some helpful tips and things to consider.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a common authorization issue related to &lt;STRONG&gt;permission propagation delays&lt;/STRONG&gt;&amp;nbsp;and &lt;STRONG&gt;ownership configuration&lt;/STRONG&gt;&amp;nbsp;when managing Databricks Unity Catalog metastores with Terraform using service principals or managed identities.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Root Cause&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The "User not authorized" error occurs after the initial successful deployment because of how Databricks handles metastore ownership and permission caching. When the metastore is created, the `owner` parameter transfers ownership away from the creating identity (the managed identity) to the specified owner. Once this happens, the managed identity running the pipeline no longer has implicit permissions to read or manage the metastore, causing subsequent Terraform runs to fail when trying to read the metastore state.&lt;/P&gt;
&lt;P&gt;Additionally, metastore admin assignment changes can take &lt;STRONG&gt;up to 30 seconds&lt;/STRONG&gt;&amp;nbsp;to propagate across the account, and may take even longer to take effect in workspaces due to caching protocols.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Solutions&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Make the Managed Identity the Metastore Owner&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Instead of setting a different owner, keep the managed identity as the owner of the metastore. Modify the resource configuration:&lt;/P&gt;
&lt;P&gt;```hcl+&lt;BR /&gt;resource "databricks_metastore" "metastore" {&lt;BR /&gt;name = var.metastore_name&lt;BR /&gt;region = var.location&lt;BR /&gt;owner = azuread_service_principal.pipeline_identity.application_id&lt;BR /&gt;provider = databricks.accounts&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;
&lt;P&gt;This ensures the managed identity retains ongoing permissions to manage the metastore.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Assign Metastore Admin Role&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If the managed identity needs to use a different owner, explicitly grant the managed identity the &lt;STRONG&gt;Metastore Admin&lt;/STRONG&gt;&amp;nbsp;role. This can be done through the Azure Databricks account console or via Terraform after the metastore is created:&lt;/P&gt;
&lt;P&gt;```hcl&lt;BR /&gt;resource "databricks_metastore" "metastore" {&lt;BR /&gt;name = var.metastore_name&lt;BR /&gt;region = var.location&lt;BR /&gt;owner = var.metastore_owner&lt;BR /&gt;provider = databricks.accounts&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;resource "databricks_grant" "metastore_admin" {&lt;BR /&gt;metastore = databricks_metastore.metastore.id&lt;BR /&gt;principal = azuread_service_principal.pipeline_identity.application_id&lt;BR /&gt;privileges = ["CREATE_CATALOG", "CREATE_STORAGE_CREDENTIAL", "CREATE_EXTERNAL_LOCATION"]&lt;BR /&gt;provider = databricks.accounts&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;
&lt;P&gt;Account admins who create metastores become the initial metastore admin automatically, but when ownership is transferred, explicit permissions are needed.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Use a Dedicated Group for Metastore Administration&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Databricks recommends using an Azure AD group as the metastore owner/admin rather than individual identities. Add the managed identity to this group:&lt;/P&gt;
&lt;P&gt;1. Create an Azure AD group for Databricks administrators&lt;BR /&gt;2. Add the managed identity to this group&lt;BR /&gt;3. Set the group as the metastore owner&lt;/P&gt;
&lt;P&gt;This approach provides better permission management and reduces propagation issues.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Account-Level vs Workspace-Level Provider&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;While using the account-level provider (`databricks.accounts`) is correct for metastore creation, be aware that some operations may work better with workspace-level providers. However, for metastore creation specifically, the account provider is the appropriate choice.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Verify Account Admin Status&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Ensure the managed identity is properly configured as an &lt;STRONG&gt;Account Admin&lt;/STRONG&gt;&amp;nbsp;in the Databricks account console. Being an account admin alone may not be sufficient if ownership is transferred without explicit ongoing permissions.&lt;/P&gt;
&lt;P&gt;Hope this helps, Louis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 16:17:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/133719#M4150</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2025-10-03T16:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Metastore</title>
      <link>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/137574#M4375</link>
      <description>&lt;P&gt;I would wonder who set this to Solved. It is not solved at all. When I try the approach suggested I get:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN class=""&gt;Error: &lt;/SPAN&gt;&lt;SPAN class=""&gt;cannot create grant: invalid Databricks Workspace configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;which is really confusing because the suggested solution is using account provider config.&lt;/P&gt;&lt;P&gt;Could you elaborate what might be the problem?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 13:12:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/137574#M4375</guid>
      <dc:creator>jzu</dc:creator>
      <dc:date>2025-11-04T13:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Metastore</title>
      <link>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/137576#M4377</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/188657"&gt;@jzu&lt;/a&gt;, I’ve unmarked the reply as the accepted solution for now since the issue persists. &lt;BR /&gt;Tagging&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/34815"&gt;@Louis_Frolio&lt;/a&gt;&amp;nbsp; for further insights on the &lt;EM&gt;invalid Databricks Workspace configuratio&lt;/EM&gt;n error.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 13:58:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/137576#M4377</guid>
      <dc:creator>Advika</dc:creator>
      <dc:date>2025-11-04T13:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Metastore</title>
      <link>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/137600#M4381</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/188657"&gt;@jzu&lt;/a&gt;&amp;nbsp;, is this a new error or is it the same as before. I need more details please. Louis.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 16:26:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/137600#M4381</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2025-11-04T16:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Metastore</title>
      <link>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/138573#M4454</link>
      <description>&lt;P&gt;Hello Louis,&lt;/P&gt;&lt;P&gt;I can give you a little background. We are using azure pipelines to deploy 4 databricks environments using terraform. We using service connection with underlying user assigned managed identities with workload federation in ado. We had several support calls with Databricks, unfortunatelly no technician we worked with was able to configure terraform deployment correctly with uami that would include creation of metastore and all workspaces and could run twice. Eventually we ended up with using local databricks spn with local password. We are quite upset we could not configure it passwordless, but we cannot invest more time into this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2025 10:59:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/problem-with-metastore/m-p/138573#M4454</guid>
      <dc:creator>jzu</dc:creator>
      <dc:date>2025-11-11T10:59:13Z</dc:date>
    </item>
  </channel>
</rss>

