Forum Discussion
keataunooi
2 years agoRegular Visitor
How to set default Lakehouse in the notebook programmatically?
Hi All, Here are my workspace setup: Workspace Fabric's Artifacts Git branch folder Fabric-Sandbox notebook: landingtoBronze lakehouse: Bronze feature/bronze123 Fabric-Dev ...
- Anonymous2 years ago
Hi keataunooi
Thanks for using Fabric Community.
To programmatically attach a lakehouse for a session level, you can use this below code in your notebook:# Welcome to your new notebook # Type here in the cell editor to add code! %%configure { "defaultLakehouse": { # This overwrites the default lakehouse for current session "name": "your-lakehouse-name", #"id": "<(optional) lakehouse-id>", #"workspaceId": "<(optional) workspace-id-that-contains-the-lakehouse>" # Add workspace ID if it's from another workspace } }
Hope this helps. Please let me know if you have any further questions.
Anonymous
2 years agoNot applicable
Hi keataunooi
Thanks for using Fabric Community.
To programmatically attach a lakehouse for a session level, you can use this below code in your notebook:
# Welcome to your new notebook
# Type here in the cell editor to add code!
%%configure
{
"defaultLakehouse": { # This overwrites the default lakehouse for current session
"name": "your-lakehouse-name",
#"id": "<(optional) lakehouse-id>",
#"workspaceId": "<(optional) workspace-id-that-contains-the-lakehouse>" # Add workspace ID if it's from another workspace
}
}
Hope this helps. Please let me know if you have any further questions.
lyjavier
Helper I
1 year agoBut is that I have to have this cell at first in the notebook?