Forum Discussion

halcyon57a's avatar
halcyon57a
New Member
11 months ago
Solved

Extract API info from Notebooks

Hi I am using the Fabric API to trawl through all workspaces on a tenant, identifying Python notebooks and trying to read these to see if they access an API.  If one exists, then list it out.   The Notebook I am running lists the workspaces correctly, correctly identifies whether the Notebook exists and tries to extract the API data - but it doesn't.  It just returns blanks.  Any one ever done this ? Any thoughts?

 

  • Hi halcyon57a ,

    Thank you for your post in the Fabric community, and  In addition to tayloramy  earlier response. Fabric’s public API does allow you to retrieve complete notebook definitions, including all code cells. If you’re only getting metadata, that could be why the results appear blank you need to use the correct endpoint for full content.

    You can refer to the official documentation: Manage and execute Fabric notebooks with public APIs - Microsoft Fabric | Microsoft Learn

     

    This guide explains how to list notebooks, access their full content, and handle formats such as .ipynb, .py, and .sql. For .ipynb notebooks.

    Regards,
    Yugandhar.

6 Replies

  • Hi halcyon57a ,

    Thank you for your post in the Fabric community, and  In addition to tayloramy  earlier response. Fabric’s public API does allow you to retrieve complete notebook definitions, including all code cells. If you’re only getting metadata, that could be why the results appear blank you need to use the correct endpoint for full content.

    You can refer to the official documentation: Manage and execute Fabric notebooks with public APIs - Microsoft Fabric | Microsoft Learn

     

    This guide explains how to list notebooks, access their full content, and handle formats such as .ipynb, .py, and .sql. For .ipynb notebooks.

    Regards,
    Yugandhar.

  • What Might Be Going Wrong

    Here are some common culprits:

    1. Notebook Content Access Limitations
      • The Fabric API can list notebooks, but reading their internal code cells isn't always straightforward. If you're using the REST API to fetch notebook metadata, it may not include the actual code content unless explicitly supported.
      • Notebook Format
        • Fabric notebooks are stored in a proprietary format, not plain .ipynb. So unless you're parsing the actual notebook file correctly, you might just be getting metadata (like name, ID) but not the code itself.
        • Authentication Scope
          • If you're using a Service Principal, make sure it has the right permissions to access notebook contents. Some API endpoints may still be limited in preview and not support full content extraction.
          • Code Parsing Logic
  • Hi halcyon57a ,

    May I know if the issue has been resolved, or are you still facing any challenges? Please let us know if you need any additional details or assistance.

     

    Thanks.

  • Hi halcyon57a ,
    Can you let us know whether your issue has been resolved or if you're still having trouble? Your feedback is important and could assist others with similar concerns.

     

    Thank You.

  • Hi halcyon57a ,

    When you have a moment, please let us know if everything is okay on your end or if you need any further assistance.

     

    Thank you.