Forum Discussion

NickdeZeeuw's avatar
NickdeZeeuw
Regular Visitor
5 months ago
Solved

Created shortcuts via REST API not accessible via notebook

Hello all,

 

I created a shortcut from a notebook via the REST API in the gold lakehouse from the silver lakehouse. We have schema's enabled in the lakehouses, so the shortcut is created in a schema in the gold lakehouse. This works fine, the shortcut is created and I can query it from the gold lakehouse. The problem is, I can't query this from a notebook, I get a bad request 400 error. I do see the tables in the explorer ribbon in the notebook, but can't access it. Strange thing is, when I create the shortcut via the UI in the lakehouse, I get exactly the same shortcut in the same location and this one I can query from the notebook.

 

Any ideas on where the problem can be?

 

Thanks!

  • NickdeZeeuw's avatar
    NickdeZeeuw
    5 months ago

    Hello,

     

    Not realy resolved, but seems a known limitation. So solved it for now via workaround.

     

    Creating a shortcut via API works, but can't access them via a notebook, I gat a 400 bad request. Seems that the schema enablement in the lakehouse has something to do with this. For now created a schema shortcut manually via UI.

9 Replies

  • Hello NickdeZeeuw 

     

    You can try resetting the OneLake shortcut cache that forces Fabric to clear any cached metadata and file mappings for shortcuts and re-resolve them from the target location. This is useful after creating or modifying shortcuts programmatically, as stale cache entries can cause notebooks or Spark queries to fail even though the shortcut appears correctly in the Lakehouse UI. 

     

    The reset is performed using the Reset Shortcut Cache REST API on the lakehouse item and is safe because it doesn’t delete data or shortcuts—only cached references. Once reset, Spark and other Fabric workloads will re-discover the shortcut and typically regain query access without requiring the shortcut to be recreated.

     

    The Reset Shortcut Cache can be found here:

    OneLake Shortcuts - Reset Shortcut Cache - REST API (Core) | Microsoft Learn

     

    • NickdeZeeuw's avatar
      NickdeZeeuw
      Regular Visitor

      Hello deborshi_nag,

       

      Thanks for the quick reply! Is this also needed when the shotcut is to another lakehouse, not an external storage like AWS? And is it correct there is an option that needs to be enabled in the admin portal?

      I get the following respons: Failed: 400 {"requestId":"xxxx-xxx-xxx-xxx-x","errorCode":"BadRequest","moreDetails":[{"errorCode":"BadRequest","message":"ExternalShortcutCacheDisabled"}],"message":"The request could not be processed due to missing or invalid information"}

      Seems that the option for shortcut caching can't be found..

       

      • deborshi_nag's avatar
        deborshi_nag
        Super User

        ah, it seems that the schema enabled Lakehouse is the reason behind it. 

         

        When you create a shortcut through the REST API in a schema-enabled lakehouse, Fabric registers it correctly at the SQL layer, which is why the shortcut appears in Explorer and works fine through the SQL Analytics endpoint. However, the notebook runtime depends on an additional metadata layer that the REST-created shortcut doesn’t populate, leading to 400 BadRequest errors in notebooks even though the shortcut is visible.

         

        When you create the same shortcut through the UI, Fabric automatically registers the extra Spark‑visible metadata. This is why the UI version works everywhere, while the REST version fails only inside notebooks. Resetting the shortcut cache also won’t help here, as schema-enabled lakehouses don’t support external shortcut cache refresh, which is why you get ExternalShortcutCacheDisabled.

         

        The only reliable workaround today is to delete and recreate the shortcut through the Fabric UI. That ensures both the SQL and Spark runtimes register the shortcut correctly so notebooks can access it. 

         

  • Hi @NickdeZeeuw 

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


    Thank you.

  • Hi NickdeZeeuw 

    May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


    Thank you

    • NickdeZeeuw's avatar
      NickdeZeeuw
      Regular Visitor

      Hello,

       

      Not realy resolved, but seems a known limitation. So solved it for now via workaround.

       

      Creating a shortcut via API works, but can't access them via a notebook, I gat a 400 bad request. Seems that the schema enablement in the lakehouse has something to do with this. For now created a schema shortcut manually via UI.

      • v-nmadadi-msft's avatar
        v-nmadadi-msft
        Community Support

        Hi NickdeZeeuw ,

        We really appreciate your efforts and for letting us know the update on the issue.

        Please continue using fabric community forum for your further assistance.

         Regards