Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tacovanasselt
Regular Visitor

Is it possible to get the path of a notebook in a fabric folder

Using 

notebookutils.notebook.get or 
notebookutils.notebook.list or
f"/v1/workspaces/{WORKSPACE_ID}/items/{ARTIFACT_ID}/GetDefinition or
f"/v1/workspaces/{WORKSPACE_ID}/items/
i get the names of the notebooks but i want to use the paths of the notebooks for notebook orchastration using DAG.
How can i get the path of the fabric notebook? 
1 ACCEPTED SOLUTION
v-jingzhan-msft
Community Support
Community Support

Hi @tacovanasselt 

 

It seems that there is currently no direct API or command to provide the notebook path. If you want a path that includes the workspace ID and notebook ID, you can obtain these IDs and then concatenate them with the base path. For example,

all_notebooks = notebookutils.notebook.list("your workspace id")

for nb in all_notebooks:
    workspace_id = nb['workspaceId']
    notebook_id = nb['id']
    # notebook_name = nb['displayName']
    notebook_path = f"/v1/workspaces/{workspace_id}/items/{notebook_id}"
    print(notebook_path)

 

If you want to use DAG, according to the documentation, the notebook path it requires is just the notebook name. You're already able to get the names of the notebooks. 

 

Hope this would be helpful. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
v-jingzhan-msft
Community Support
Community Support

Hi @tacovanasselt 

 

It seems that there is currently no direct API or command to provide the notebook path. If you want a path that includes the workspace ID and notebook ID, you can obtain these IDs and then concatenate them with the base path. For example,

all_notebooks = notebookutils.notebook.list("your workspace id")

for nb in all_notebooks:
    workspace_id = nb['workspaceId']
    notebook_id = nb['id']
    # notebook_name = nb['displayName']
    notebook_path = f"/v1/workspaces/{workspace_id}/items/{notebook_id}"
    print(notebook_path)

 

If you want to use DAG, according to the documentation, the notebook path it requires is just the notebook name. You're already able to get the names of the notebooks. 

 

Hope this would be helpful. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Don't think this is what the orig poster is looking for.  They are looking to get the folder path of a workspace.  shown as location in the about page of the notebook.  We are looking to get this as well so we can use notebook folder placement to drive schedule orchestration

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.