D๐ฒ๐ง๐š๐ฆ๐ข๐œ๐š๐ฅ๐ฅ๐ฒ ๐ฌ๐ž๐ญ ๐ฒ๐จ๐ฎ๐ซ ๐๐ž๐Ÿ๐š๐ฎ๐ฅ๐ญ ๐ฅ๐š๐ค๐ž๐ก๐จ๐ฎ๐ฌ๐ž for Notebooks
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!
2
0 comments
Guna Sekhar
1
D๐ฒ๐ง๐š๐ฆ๐ข๐œ๐š๐ฅ๐ฅ๐ฒ ๐ฌ๐ž๐ญ ๐ฒ๐จ๐ฎ๐ซ ๐๐ž๐Ÿ๐š๐ฎ๐ฅ๐ญ ๐ฅ๐š๐ค๐ž๐ก๐จ๐ฎ๐ฌ๐ž for Notebooks
Learn Microsoft Fabric
skool.com/microsoft-fabric
Helping passionate analysts, data engineers, data scientists (& more) to advance their careers on the Microsoft Fabric platform.
Leaderboard (30-day)
Powered by