Hey Microsoft Fabric folks, now you can ๐๐ฒ๐ง๐๐ฆ๐ข๐๐๐ฅ๐ฅ๐ฒ ๐ฌ๐๐ญ ๐ฒ๐จ๐ฎ๐ซ ๐๐๐๐๐ฎ๐ฅ๐ญ ๐ฅ๐๐ค๐๐ก๐จ๐ฎ๐ฌ๐ in Microsoft Fabric notebooksโit's now generally available and makes managing environments easy! This can be done even across workspaces using variable library values, so no more manual UI Lakehouse attachment needed, when switching dev/test/prod.
Here's how to set it up - super easy:
โข First, create a ๐๐๐ซ๐ข๐๐๐ฅ๐ ๐๐ข๐๐ซ๐๐ซ๐ฒ in your workspace (e.g., name it "myVL").
โข Add string variables like:
- LHname โ your lakehouse name
- LHid โ lakehouse ID (needed only for cross-workspace)
- WorkspaceId โ target workspace ID (needed only for cross-workspace)
โข In your notebook, make the ๐ฏ๐๐ซ๐ฒ ๐๐ข๐ซ๐ฌ๐ญ ๐๐๐ฅ๐ฅ a ๐๐ฒ๐๐ฉ๐๐ซ๐ค cell and add this code:
%%configure
{
"defaultLakehouse": {
"name": {
"variableName": "$(/**/myVL/LHname)"
},
"id": {
"variableName": "$(/**/myVL/LHid)"
},
"workspaceId": {
"variableName": "$(/**/myVL/WorkspaceId)"
}
}
}
โข Run the cell (it may ask to restart the sessionโjust say yes).
That's all! Your notebook now automatically uses the lakehouse from your variables. Drop the id/workspaceId parts if it's in the same workspace.
Perfect for reusable notebooks and automated pipelines.
Who's already using this? Drop your thoughts below!