How do I release a name of the deleted workspace, I need to recreate it in a different subscription

Dimitry Nechaev 50 Reputation points
2025-11-27T23:33:32.4566667+00:00

I've created Databricks workspaces using bicep but forgot to change subscription when creating a production one. So I immediately deleted workspace that I accidentally created in the dev subscription and recreated in the prod one.

Unfortunately the metastore holds to the deleted name.

How can I release the name to reuse it?

User's image

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
{count} votes

Answer recommended by moderator
  1. Dimitry Nechaev 50 Reputation points
    2025-11-28T03:33:15.1733333+00:00

    It appears to be something that Databricks currently does not expose neither though UI or API.

    My solution was to delete the entire metastore. Once metastore was deleted, the workspace in this metastore was unable to show the catalog page. It was blinking and broken.

    After deleting metastore I deleted the workspace.

    Deleted metastore still can be queried via API, but all workspaces on it will throw error on getting. They only show in the account.workspaces.list command as a list of IDs. This metastore data seems to be going to sit there forever.

    I've created new workspace, after none left. New workspace sits in the different instance of the metastore, and so it does not have naming conflict anymore.

    I would say this situation is very difficult to resolve, and I would have had a weirdly named default catalog forever if I already had other workspaces in the region.

    Perhaps having own metastore storage is a better solution to it.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Adam Zachary 2,025 Reputation points
    2025-11-28T02:05:31.4366667+00:00

    I ran into this same problem a while ago.

    The confusing part is that deleting the Databricks workspace does not delete anything in Unity Catalog. The catalog name stays locked at the metastore level, so when you try to recreate it in another subscription, Databricks thinks the name still exists.

    To fix it, you have to remove the catalog from the metastore itself.

    The quickest way is:

    Option 1: Delete it in the Databricks Account Console Go to Account Console → Unity Catalog → Catalogs, find the old catalog, and delete it. Once it is removed there, the name becomes available immediately.

    Option 2: Drop it with SQL (if you still have a workspace attached to that metastore):

    DROP CATALOG bobjane_prod CASCADE;
    

    After the catalog is actually removed from the metastore, you can recreate it in the correct subscription with no issues.


  2. Dimitry Nechaev 50 Reputation points
    2025-11-28T02:44:12.0233333+00:00

    I have also tried using Accounts API

    Authentication with service principal is almost impossible task with Postman, but I figured using Python and SDK

    from databricks.sdk import AccountClient
    
    a = AccountClient(
      host          = 'https://accounts.azuredatabricks.net',
      account_id    = 'b8166482-c2ea-4988-a5fc-c705a73b6507',
      client_id     = '<>',
      client_secret = '<>'
    )
    
    metastore_id = '24e64710-e14c-4292-83ca-e14490dcce4c'
    workspaces = a.metastore_assignments.list(metastore_id)
    
    print(workspaces)
    # outputs [1622024750688706, 2788133036224279, 3381495709332788]
    
    workspace = a.workspaces.get('2788133036224279')
    ^^^ ERROR databricks.sdk.errors.platform.ResourceDoesNotExist: Workspace with id 2788133036224279 does not exist in the workspaces table
    

    So even though metastore clearly shows the deleted workspace, accessing it for get/delete functions throws error "databricks.sdk.errors.platform.ResourceDoesNotExist: Workspace with id 2788133036224279 does not exist in the workspaces table"

    It really sucks.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.