Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
I have a few Link to Fabric Lakehouses connected to different Dataverse environments that I was creating shortcuts from into another lakehouse LH_DP in another workspace. I programmatically deleted the shortcuts in LH_DP and tried to recreate them as I was changing environments but when I try to recreate the shortcut I keep getting a 400 Bad Request error message:
Error: {"requestId":"xyz","errorCode":"BadRequest","moreDetails":[{"errorCode":"ShortcutNotFound","message":"Shortcut table_name is not found"}],"message":"The request could not be processed due to missing or invalid information"}
I have been running this approach in notebooks for months but now I'm not able to recreate the shortcuts anymore.
One thing I noticed was that if I run the notebookutils.fs.ls command I can still see the parent directory of the shortcut but it is empty.
Any assistance would be appreciated.
Solved! Go to Solution.
So I figured out what the problem was. The OneLake Delete Shortcut API endpoint has quietly changed behaviour to delete the shortcut but still keeping the storage folder in the file system of the lakehouse under the hood.
https://learn.microsoft.com/en-us/rest/api/fabric/core/onelake-shortcuts/delete-shortcut?tabs=HTTP
This makes this API endpoint redundant if anyone is planning on deleting and recreating shortcuts with the exact same names. The workaround is to delete the files and folders using notebookutils.fs.rm in a notebook for example which deletes the shortcut and the corresponding files.
So I figured out what the problem was. The OneLake Delete Shortcut API endpoint has quietly changed behaviour to delete the shortcut but still keeping the storage folder in the file system of the lakehouse under the hood.
https://learn.microsoft.com/en-us/rest/api/fabric/core/onelake-shortcuts/delete-shortcut?tabs=HTTP
This makes this API endpoint redundant if anyone is planning on deleting and recreating shortcuts with the exact same names. The workaround is to delete the files and folders using notebookutils.fs.rm in a notebook for example which deletes the shortcut and the corresponding files.
I have experienced a similar problem today - I had a function to delete a shortcut using the API and when I ran the command it never gave a response (normally I get a success response in 30-40 seconds) and just carried on running. I could see the shortcut had disappeared but I got an error when trying to recreate it through the API. When I tried to recreate it through the front end it gave it a "_1" suffix. I tried to rename it using the new manage shortcut functionality in the front-end to the desired name and that gave me "There is a currently a lease on the resource and no lease ID was specified in the request" error, which brought me to this thread.
Can I confirm what you did to resolve the situation with a shortcut you had deleted through the API that you wanted to rebuild? I have tried to use notebookutils.fs.rm by doing the following:
1) Running notebookutils.fs.ls("Tables/") which confirmed there was an underlying folder still there for my shortcut
2) Ran notebookutils.fs.rm('Tables/[shortcutname]', True) (where [shortcutname] is my shortcutname) to try and delete it but I get the error "There is currently a lease on the resource and no lease ID was specified in the request" again.
This seems like a serious bug if you are unable to recreate a shortcut with the same name after deleting it.
Thanks
Hi,
If you had already deleted the shortcut throught the Delete Shortcut API endpoint then I'm afraid there's no workaround. The file/folder representing the shortcut will forever be in the lakehouse and will have the "lease" on it and you cannot delete it.
I had to backup my lakehouse, delete it altogether then recreate it and reload the tables (physical tables, not shortcuts) from the backup by using a data pipeline. I believe all of those recent changes were introduced because shortcuts can now be source controlled.
My advice would be to disregard deleting shortcuts and only rely on the ShortcutConflictPolicy=CreateOrOverwrite URI parameter in the create shortcut API endpoint. This helps overwrite shortcuts that are checked into source control e.g. dev environment shortcuts are checked into git but you need to overwrite them in your UAT environment with the UAT shortcuts.
If you REALLY want to delete shortcuts then run notebookutils.fs.rm('Tables/[shortcutname]', True) in your notebook instead of the delete shortcut API - it is practically useless now.
Hi, I raised a support ticket and this is a bug. A fix is going to be rolled out.
There is a workaround in the meantime for shortcuts that have not been fully deleted through the API - you can connect to the lakehouse in Azure Storage Explorer (Integrate OneLake with Azure Storage Explorer - Microsoft Fabric | Microsoft Learn), find the file for the shortcut that has not been fully deleted and then Right click on it and choose "Break Lease". You can then delete the lingering file and recreate the shortcut.
Hi @belshekheiby,
Glad your issue has been resolved!
I suggest you to accept your own post as the solution — it will help other community members facing similar problems to find the answer faster.
Regards,
Vinay Pabbu
Hi,
Steps to Resolve the Issue
from notebookutils import mssparkutils
mssparkutils.fs.rm("abfss://<workspace>@<lakehouse>.dfs.fabric.microsoft.com/<lakehouse_name>/Tables/<shortcut_directory>", True)
Replace the placeholders with your workspace, Lakehouse, and directory names.
curl -X POST "https://api.fabric.microsoft.com/v1/workspaces/<workspace_id>/lakehouses/<lakehouse_id>/shortcuts" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "table_name",
"path": "Tables",
"target": {
"oneLake": {
"workspaceId": "<source_workspace_id>",
"lakehouseId": "<source_lakehouse_id>",
"path": "Tables/table_name"
}
}
}'
If the API call fails with the same 400 error, double-check the target path and ensure the table exists in the source Lakehouse.
Hi,
Thank you for your reply.
Here are steps that I have already tried to debug this problem, some of them align with the steps above:
I had this code running for months. It was deleting and recreating shortcuts on the fly since it was developed before introducing the ShortcutConflictPolicy=CreateOrOverwrite. The main issue here is the behaviour of shortcut deletion which leaves these residue files in the lakehouse which has never been the case before the last Fabric update this past weekend.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.