Forum Discussion
Rest Api to create notebook in folder
Do we have an api to create or update notebook or data pipeline in a folder in fabric workspace?
Hi vi1996ash
You can use the Microsoft Fabric REST APIs to create and update notebooks and data pipelines within a workspace, but direct folder (subfolder) targeting is not currently available through the API. All items are created at the workspace level, and folder management require manual steps
6 Replies
- nilendraFabricSuper User
Hi vi1996ash
You can use the Microsoft Fabric REST APIs to create and update notebooks and data pipelines within a workspace, but direct folder (subfolder) targeting is not currently available through the API. All items are created at the workspace level, and folder management require manual steps
- SrisakthiSuper User
Hi vi1996ash ,
You can create notebooks using api and manually move to the folder.
Here is the sample snippet using python
def create_update_notebook_definition(notebook_name):
notebook_details = {
"displayName": f'{notebook_name}'
}
response = requests.post(
url = f"https://api.fabric.microsoft.com/v1/workspaces/{target_workspace_id}/notebooks",
headers=headers,
json=notebook_details,
verify=False)Regards,
Srisakthi
- AnonymousNot applicable
Hi vi1996ash ,
Has the issue been resolved on your end? If so, please share your solution and mark it as "Accept as Solution." This will assist others in the community who are dealing with similar problems and help them find a solution more quickly.
Thank you. - burakkaragozSuper User
Hi vi1996ash ,
Yes, it is possible to create notebooks or pipelines inside a workspace using the REST API on Microsoft Fabric, but currently there is no specific API that supports creating notebooks directly inside a folder.
Alternative Approach:
You can create notebooks at the workspace level with the Microsoft Fabric REST API.
The created notebooks are placed in the default folder.
Since folder structure support is still limited, GUI or manual intervention may be required for folder-based placement or migration.
For CICD Scenarios:
Automation can be done with REST API calls via Azure DevOps or GitHub Actions.
It is possible to send Notebook content in JSON format via API. - AnonymousNot applicable
Hi vi1996ash ,
Following up to check whether you got a chance to review the suggestion given.I hope it helps.If so,consider accepting it as solution,it will be helpful for other members of the community who have similar problems as yours to solve it faster. Glad to help.
Thank you. - AnonymousNot applicable
Hi vi1996ash ,
Could you please confirm if the issue has been resolved on your end? If a solution has been found, it would be greatly appreciated if you could share your insights with the community. This would be helpful for other members who may encounter similar issues.
Thank you for your understanding and assistance.