<?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: Error when trying to destory databricks_permissions with OpenTofu in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/error-when-trying-to-destory-databricks-permissions-with/m-p/133444#M4134</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/23233"&gt;@NandiniN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you so much for your reply.&lt;/P&gt;&lt;P&gt;I tried out your suggestion and tofu was indeed able to destroy "the rest" of the workspace infrastructure once I manually removed the &lt;STRONG&gt;databricks_permissions&amp;nbsp;&lt;/STRONG&gt;from the state. Although this works now it seems more like a workaround to me. I am still of the opinion that it should be possible to destroy all of the resources you created with tofu.&lt;/P&gt;&lt;P&gt;Fortunately there seems to be a silver lining as I found an existing &lt;A href="https://github.com/databricks/terraform-provider-databricks/pull/4609" target="_blank" rel="noopener"&gt;pull request&lt;/A&gt; for the databricks tofu provider on github which introduces an additive "&lt;STRONG&gt;databricks_permission&lt;/STRONG&gt;" resource which allows you to add additional permissions without overwriting existing ones. I'm really looking forward to that.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Oct 2025 12:53:34 GMT</pubDate>
    <dc:creator>MiriamHundemer</dc:creator>
    <dc:date>2025-10-01T12:53:34Z</dc:date>
    <item>
      <title>Error when trying to destory databricks_permissions with OpenTofu</title>
      <link>https://community.databricks.com/t5/administration-architecture/error-when-trying-to-destory-databricks-permissions-with/m-p/132904#M4087</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In our company's project we created a databricks_user for a service account (which is needed for our deployment process) via OpenTofu and afterwards adjusted permissions to that "user's" user folder using the databricks_permissions resource.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;resource "databricks_user" "databricks_deployment_sa" {
  allow_cluster_create = true
  display_name         = "Databricks Deployment SA"
  provider             = databricks.workspace
  user_name            = var.google_service_account_email
  workspace_access     = true
}

resource "databricks_permissions" "add_folder_permission" {
  #  directory_path = databricks_directory.sa_user_folder.path
  directory_path = databricks_user.databricks_deployment_sa.home

  dynamic "access_control" {
    for_each = [
      data.databricks_group.xxx,
      data.databricks_group.xxx
    ]
    content {
      group_name       = access_control.value
      permission_level = "CAN_MANAGE"
    }
  }
  access_control {
    permission_level = "CAN_MANAGE"
    user_name        = var.google_service_account_email
  }
  provider = databricks.workspace
}&lt;/LI-CODE&gt;&lt;P&gt;If I want to destroy these resources however, tofu throws an error, saying that it cannot remove the CAN_MANAGE permission of the service account..&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error: cannot delete permissions: Cannot remove &amp;lt;service_account_email&amp;gt;'s CAN_MANAGE permission on 716423664771912&lt;/LI-CODE&gt;&lt;P&gt;So now it seems to me, that I am no longer able to destroy my tofu managed workspace as long as I have this databricks_permissions block in my tofu code.&lt;/P&gt;&lt;P&gt;The databricks workspace in question is part of a test environment to test infrastructural changes without effecting the productive work so it would really be necessary to destroy tofu managed infrastructure.&lt;/P&gt;&lt;P&gt;Are there any ideas how I could accomplish this? Help would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 07:53:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/error-when-trying-to-destory-databricks-permissions-with/m-p/132904#M4087</guid>
      <dc:creator>MiriamHundemer</dc:creator>
      <dc:date>2025-09-24T07:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error when trying to destory databricks_permissions with OpenTofu</title>
      <link>https://community.databricks.com/t5/administration-architecture/error-when-trying-to-destory-databricks-permissions-with/m-p/133067#M4102</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/155481"&gt;@MiriamHundemer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The issue occurs because the owner of the &lt;STRONG&gt;home&lt;/STRONG&gt; folder (in this case, the &lt;CODE&gt;databricks_user.databricks_deployment_sa&lt;/CODE&gt; service account) often has an &lt;STRONG&gt;unremovable &lt;CODE&gt;CAN_MANAGE&lt;/CODE&gt; permission&lt;/STRONG&gt; on its own home directory.&lt;/P&gt;
&lt;P&gt;When OpenTofu attempts to destroy the &lt;CODE&gt;databricks_permissions&lt;/CODE&gt; resource, it tries to revert the permissions to the state &lt;I&gt;before&lt;/I&gt; the resource was applied (or completely remove all permissions if the resource is being destroyed). Because it cannot remove the owner's inherent &lt;CODE&gt;CAN_MANAGE&lt;/CODE&gt; permission, the destruction fails.&lt;/P&gt;
&lt;P&gt;To resolve this, you can tell OpenTofu to &lt;STRONG&gt;forget&lt;/STRONG&gt; it's managing the &lt;CODE&gt;databricks_permissions&lt;/CODE&gt; resource without actually destroying the underlying permissions.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Remove the resource from the OpenTofu state, using the &lt;CODE&gt;tofu state rm&lt;/CODE&gt; command, which tells OpenTofu to Stop tracking this resource, but don't try to destroy it.&lt;/LI&gt;
&lt;LI&gt;Run &lt;CODE&gt;tofu destroy&lt;/CODE&gt; again&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;When the &lt;CODE&gt;databricks_user&lt;/CODE&gt; is destroyed, its home directory and all associated files/permissions will be deleted by Databricks, including the unremovable permission that caused the initial error.&lt;/P&gt;
&lt;P&gt;Please let me know if this works.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 10:12:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/error-when-trying-to-destory-databricks-permissions-with/m-p/133067#M4102</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2025-09-26T10:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error when trying to destory databricks_permissions with OpenTofu</title>
      <link>https://community.databricks.com/t5/administration-architecture/error-when-trying-to-destory-databricks-permissions-with/m-p/133444#M4134</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/23233"&gt;@NandiniN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you so much for your reply.&lt;/P&gt;&lt;P&gt;I tried out your suggestion and tofu was indeed able to destroy "the rest" of the workspace infrastructure once I manually removed the &lt;STRONG&gt;databricks_permissions&amp;nbsp;&lt;/STRONG&gt;from the state. Although this works now it seems more like a workaround to me. I am still of the opinion that it should be possible to destroy all of the resources you created with tofu.&lt;/P&gt;&lt;P&gt;Fortunately there seems to be a silver lining as I found an existing &lt;A href="https://github.com/databricks/terraform-provider-databricks/pull/4609" target="_blank" rel="noopener"&gt;pull request&lt;/A&gt; for the databricks tofu provider on github which introduces an additive "&lt;STRONG&gt;databricks_permission&lt;/STRONG&gt;" resource which allows you to add additional permissions without overwriting existing ones. I'm really looking forward to that.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 12:53:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/error-when-trying-to-destory-databricks-permissions-with/m-p/133444#M4134</guid>
      <dc:creator>MiriamHundemer</dc:creator>
      <dc:date>2025-10-01T12:53:34Z</dc:date>
    </item>
  </channel>
</rss>

