Skip to main content

Command Palette

Search for a command to run...

Cross Workspace Fabric Notebook Execution

Updated
2 min read
Cross Workspace Fabric Notebook Execution
W

Ex corporate consultant of 12 years turned Soloprenuer. Having a blast every day and sharing little bits of info along the way.

Specialized in data and analytics with a focus on the Microsoft tech stack (Azure, Fabric, Power BI

Have you ever tried to run a Fabric notebook in a different workspace using notebookutils? I have, and it didn’t work out so well. Thankfully, persistence wins, and now I get to share the secret sauce with all you lovely people.

The Setup

You’re going to need two workspaces, one lakehouse, and two notebooks. If you want to see another little scoop of secret sauce, create two lakehouses.

Workspace 1:

Workspace 2:

In this setup, I Speak Whale is the target workspace and lucid_is_awesome is the target notebook. just_keep_swimming is the source notebook that will be attempting to negotiate with the target.

just_keep_swimming:

lucid_is_awesome:

Pressing the Button:

When you hit the go button, the current configuration is going to be trying to execute a target notebook in the same context of the calling notebook. What’s that mean, exactly? Well, the calling notebook is attached to a default lakehouse, and that lakehouse belongs to a specific workspace. So, the calling notebook is looking for the receiving notebook in the same workspace as the calling notebooks default lakehouse. This is problematic given the two notebooks are assigned to different default lakehouses in different workspaces.

It’s basically telling you, “This isn’t where I parked my car!”

So, we have to tell it where the valid parking spot is, and to do this we need to grab the workspace GUID of the target workspace.

Round 2 - FIGHT:

Well, that didn’t work.

But wait, THERE’S MORE! If you take another look at the error, it’s telling you why it tanked AND how to fix it. Because the notebooks are hooked into different default lakehouse’, we need to add one more little nugget of goodness.

I remember trying to do this a while back and banging my head against the wall without success. And here we are, running cross-workspace jobs like nobody’s business.

Anyway, quick one today but something I ended up circling back to and thought it would be helpful.

Cheers, and remember to stay Lucid.