Forum Discussion

dzav's avatar
dzav
Icon for Advocate III rankAdvocate III
1 year ago
Solved

Can't delete orphaned lakehouse SQL analytics endopoint and semantic model

I ran into an issue where I was using a Fabric deployment pipeline to deploying a lakekehouse from one workspace to another. This was meant as a temporary copy/migration method, so after it completed, I unassigned the workspaces. Apparently, I did this too early because my target environment now has an orphaned SQL analytics endpoint and Semantic model, but no parent lakehouse. There's no obvious way to delete or rename these in the service. I tried reassigning the workspaces to the deployment pipeline and redeploy the lakehouse, but it now says that the name is already in use.

 

Does anyone have a workaround?

  • It appears that there's an auto-cleanup process running in the background because after 2-3 days of waiting the orphaned lakehouse disappears. I've done this twice now for good measure.

5 Replies

  • Hi dzav,

    1. Use Power BI REST API or PowerShell to delete the orphaned artifacts

    There’s no delete button in Fabric UI, but you can use the REST API to delete these semantic models manually:

    Power BI REST API: Delete Dataset

    DELETE https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}

     

    You’ll need:

    • Workspace ID (target workspace)
    • Dataset ID (of the orphaned semantic model)

    You can get these from:

    • Power BI Admin Portal
    • Workspace URL (the GUID)
    • Dataset list from the REST API or even the browser's dev tools

    If you're not comfortable with REST calls, I can help you write a quick PowerShell script using Invoke-RestMethod.

    1. Rename the orphaned artifact (via REST API)

    Renaming could help release the name lock so you can redeploy the original Lakehouse.

    PATCH https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}

    Content-Type: application/json

     

    {

      "name": "Orphaned_Dataset_Backup"

    }

     

    Permissions Needed

    You must have:

     

    Admin or Member access to the workspace

     

    Fabric admin permissions if using Admin APIs

     

    Either Power BI Admin role or permission to register applications for API use

    • dzav's avatar
      dzav
      Icon for Advocate III rankAdvocate III

      Dataset renaming isn't supported via REST API and the DELETE is unable to delete a dataset nested under a lakehouse. This also doesn't address the sql endpoint that's orphaned, which the REST API doesn't have methods to handle.

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi dzav 
    Could you please navigate to the workspace settings and you can delete orphaned semantic models. 
    Your issue will get resolved.

    If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
    Best Regards,
    Community Support Team _ C Srikanth.

    • dzav's avatar
      dzav
      Icon for Advocate III rankAdvocate III

      I've tried deleting the semantic model twice. The first time it deleted and reappeared immediately, and the second time it also produced this error:

      Something went wrong

      Model_FailToRemoveDatasetMessage

      Please try again later or contact support. If you contact support, please provide these details.
       
      This also doesn't address the orphaned sql endpoint (aka mirrored warehouse).
  • dzav's avatar
    dzav
    Icon for Advocate III rankAdvocate III

    It appears that there's an auto-cleanup process running in the background because after 2-3 days of waiting the orphaned lakehouse disappears. I've done this twice now for good measure.