Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowFabric Data Days Monthly is back. Join us on March 26th for two expert-led sessions on 1) Getting Started with Fabric IQ and 2) Mapping & Spacial Analytics in Fabric. Register now
You should be able to get a stack of useful info from the notebookutils.runtime.context structure.
For example, executing the below:
print(notebookutils.runtime.context['currentNotebookName'])returns to following imaginatively titled name;
MyAwesomeNotebook
The full list of things you can return is;
'currentNotebookName', 'currentWorkspaceName', 'defaultLakehouseName', 'defaultLakehouseId', 'parentRunId', 'isReferenceRun', 'defaultLakehouseWorkspaceId', 'hcReplId', 'activityId', 'defaultLakehouseWorkspaceName', 'currentWorkspaceId', 'referenceTreePath', 'clusterId', 'poolName', 'environmentId', 'currentNotebookId', 'userId', 'environmentWorkspaceId', 'userName', 'currentRunId', 'isForPipeline', 'rootRunId'
If this helps at all, please consider Accepting as a Solution so that other users may find it more easily.
You should be able to get a stack of useful info from the notebookutils.runtime.context structure.
For example, executing the below:
print(notebookutils.runtime.context['currentNotebookName'])returns to following imaginatively titled name;
MyAwesomeNotebook
The full list of things you can return is;
'currentNotebookName', 'currentWorkspaceName', 'defaultLakehouseName', 'defaultLakehouseId', 'parentRunId', 'isReferenceRun', 'defaultLakehouseWorkspaceId', 'hcReplId', 'activityId', 'defaultLakehouseWorkspaceName', 'currentWorkspaceId', 'referenceTreePath', 'clusterId', 'poolName', 'environmentId', 'currentNotebookId', 'userId', 'environmentWorkspaceId', 'userName', 'currentRunId', 'isForPipeline', 'rootRunId'
If this helps at all, please consider Accepting as a Solution so that other users may find it more easily.
Based on my understanding, Microsoft Fabric doesn’t provide an automatic way to get the current notebook name from within the notebook interface.
You need to either manually pass the notebook id or hardcode the notebook name
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Fabric update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 7 | |
| 4 | |
| 3 | |
| 3 |