Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
I want to configure the default lakehouse of my notebook programatically, I want the default lakehouse to be passed through parameters.
I've found a way to configure the default lakehouse with %%configure script:
It works if I directly write the lakehouse name, id and workspace id in the same cell, and I run this cell the first one before the rest of the cells. But I want these three values to be passed by parameter, so I need to run parameters cell before %%configure cell, and if I do that, I get and error:
MagicUsageError: The current running Livy session must be restarted for the config changes to take effect. Specify the argument "-f" to force restarting Livy session. Any variables stored in memory will be cleared.
So, how can I pass the parameters to %%configure cell if I have to run %%configure cell before any other to work?
Solved! Go to Solution.
Hi @amaaiia,
You can use Parameterized session configuration for this:
Below is an example code snippet
%%configure
{
"defaultLakehouse": {
"name": {
"parameterName": "defaultLakehouseName",
"defaultValue": "FourthLakehouse"
},
"id": {
"parameterName": "defaultLakehouseId",
"defaultValue": "773faa37-826f-4f9b-830f-e2a7a23e3903"
}
}
}
Hi @amaaiia,
You can use Parameterized session configuration for this:
Below is an example code snippet
%%configure
{
"defaultLakehouse": {
"name": {
"parameterName": "defaultLakehouseName",
"defaultValue": "FourthLakehouse"
},
"id": {
"parameterName": "defaultLakehouseId",
"defaultValue": "773faa37-826f-4f9b-830f-e2a7a23e3903"
}
}
}
Is there a way to supply additional parameteres for use later on in the notebook?
It works!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
9 | |
4 | |
3 | |
3 | |
2 |