Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello,
I have a lakehouse that get data from the dataverse (F&O) and has like 1,000+ tables, and that is my main source of data.
I create shortcust to other lakehouses from my main lakehouse. (the main lakehouse was created by the system when I enabled azure synapse link - fabric), and the rest were created by me, and they are all schema enabled.
I have been trying to create a notebook/powershell/cli, something that will let me create shortcuts from another lakehouse to my main one, without seaching table by table, as there is not really a search option, and you need to scroll down.
curl -X POST "https://api.fabric.microsoft.com/v1/workspaces/<workspaceid>/items/<lakehouseid>/shortcuts" ^
-H "Authorization: Bearer YOUR_TOKEN_HERE" ^
-H "Content-Type: application/json" ^
-d "{\"name\":\"custtable\",\"path\":\"Tables/custtable\",\"target\":{\"oneLake\":{\"workspaceId\":\"<workspaceid>\",\"itemId\":\"<lakehouseid>\",\"path\":\"Tables/custtable\",\"itemType\":\"Lakehouse\"}}}"The closest I came to being able to create a short cut is with cli, but it creates a schema with the table name.
And ideas, on how to?
thanks
Solved! Go to Solution.
Hi @AstridM ,
The 404 Not Found error occurs because your lakehouse is schema-enabled, which is the case for those created automatically by Synapse Link as well.
In schema-enabled lakehouses, tables are not available directly under the /tables endpoint, so the call fails. Instead, you should first use the GET /schemas API to list the available schemas in the lakehouse, and then call GET /schemas/{schemaName}/tables to retrieve the tables within each schema.
Once you have the table names, you can loop through them and create the shortcuts using the OneLake Shortcuts API, setting the path to Tables/<tableName> in your destination lakehouse. This approach works for both system-created and manually created schema-enabled lakehouses.
For details, please refer to the documentation: OneLake Shortcuts - REST API (Core) | Microsoft Learn
Hope this helps. Please feel free to rech out for any further questions.
Thank you .
Hi @AstridM ,
We haven’t received an update from you in some time. Could you please let us know if the issue has been resolved?
If you still require support, please let us know, we are happy to assist you.
Thank you.
Hi @AstridM ,
Thanks for reaching out to the Microsoft fabric community forum.
Could you please let us know if the issue has been resolved? I wanted to check if you had the opportunity to review the information provided by @tayloramy . If you still require support, please let us know, we are happy to assist you.
Thank you
Hi @AstridM,
You are on the right track. The way to automate this at scale is:
enumerate the source lakehouse tables, and
loop over them calling the Fabric REST API to create shortcuts in your destination lakehouse under Tables/<tableName>.
Use the Lakehouse Tables API to list table names from your source lakehouse. Then POST to the OneLake Shortcuts API for each name, setting path to Tables/<tableName> and target.oneLake to the source item.
Docs: List Tables, Create Shortcut, OneLake shortcuts overview.If you prefer to do this inside a Fabric notebook, you can fetch a bearer token with mssparkutils.credentials.getToken("https://api.fabric.microsoft.com/") and call the REST APIs in a loop. Community confirmation: thread on getting tokens in notebooks
CLI confusion that creates a schema-like folder usually comes from using a path like Tables/schema/table. For lakehouse tables, point shortcuts directly to Tables/<tableName>. This places the shortcut in the Tables tree and makes it queryable in SQL Endpoint. See: Create and manage a OneLake shortcut.
Example: Python in a Fabric notebook (Not tested, but should at least get you most of the way there)
import requests
workspace_id_src="<source_ws>"
lakehouse_id_src="<source_lakehouse>"
workspace_id_dst = "<dest_ws>"
lakehouse_id_dst = "<dest_lakehouse>"
# 1) Get a bearer token scoped to Fabric API
token = mssparkutils.credentials.getToken("https://api.fabric.microsoft.com/")
# 2) List tables from source lakehouse
tables_url = f"https://api.fabric.microsoft.com/v1/workspaces/{workspace_id_src}/items/{lakehouse_id_src}/tables"
tables = []
next_url = tables_url
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
while next_url:
r = requests.get(next_url, headers=headers)
r.raise_for_status()
data = r.json()
tables.extend([t["name"] for t in data.get("value", [])])
next_url = data.get("@odata.nextLink")
# 3) Create shortcuts in destination lakehouse under Tables/<name>
create_url = f"https://api.fabric.microsoft.com/v1/workspaces/{workspace_id_dst}/items/{lakehouse_id_dst}/shortcuts"
for name in tables:
body = {
"name": name, # display name; Tables leaf drives table name in UI
"path": f"Tables/{name}",
"target": {
"oneLake": {
"workspaceId": workspace_id_src,
"itemId": lakehouse_id_src,
"path": f"Tables/{name}",
"itemType": "Lakehouse"
}
}
}
resp = requests.post(create_url, headers=headers, json=body)
if resp.status_code not in (200, 201):
print(f"Failed for {name}: {resp.status_code} {resp.text}")If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.
Good morning, thanks, but it is not working, I tried this before, I get HTTPError: 404 Client Error: Not Found for url: api.fabric.microsoft.com/v1/workspaces/workspace_id/items/lakehouse_id/tables, from what I google it said because of the schema enable lakehouse, but I am not sure if it is that, or it is because it is a lakehouse created by the system with export to synapse link to the one lake in fabric.
Hi @AstridM ,
The 404 Not Found error occurs because your lakehouse is schema-enabled, which is the case for those created automatically by Synapse Link as well.
In schema-enabled lakehouses, tables are not available directly under the /tables endpoint, so the call fails. Instead, you should first use the GET /schemas API to list the available schemas in the lakehouse, and then call GET /schemas/{schemaName}/tables to retrieve the tables within each schema.
Once you have the table names, you can loop through them and create the shortcuts using the OneLake Shortcuts API, setting the path to Tables/<tableName> in your destination lakehouse. This approach works for both system-created and manually created schema-enabled lakehouses.
For details, please refer to the documentation: OneLake Shortcuts - REST API (Core) | Microsoft Learn
Hope this helps. Please feel free to rech out for any further questions.
Thank you .
Hi @AstridM ,
I wanted to follow up on our previous suggestions. We would like to hear back from you to ensure we can assist you further.
Thank you.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 13 | |
| 6 | |
| 2 | |
| 2 | |
| 2 |