Forum Discussion

AstridM's avatar
AstridM
Advocate I
10 months ago
Solved

Automate creating shortcusts

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....
  • Anonymous's avatar
    Anonymous
    10 months ago

    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 .