In the high-stakes world of data architecture, where downtime can cascade into real business disruptions, I’ve learned that even the most robust platforms have their blind spots. Just last month, while collaborating with a client’s Architecture team on their disaster recovery strategy, we uncovered a subtle but critical gap in Microsoft Fabric: while OneLake thoughtfully mirrors data across multiple regions by default, other workspace items—like notebooks, semantic models, and pipelines—aren’t directly accessible in a failover scenario without extra steps. For the nitty-gritty on Fabric’s built-in reliability features, check out this Microsoft Learn guide.

That’s the spark that led me down this rabbit hole, and in this post, I’ll walk you through a practical solution: a Python Notebook that automates backing up your entire Fabric workspace to OneLake and an Azure Storage Account for that extra layer of redundancy. Whether you’re prepping for the worst or just embracing the “better safe than sorry” mindset, this approach gives you portable, versioned copies you can restore quickly.

I will have a link to the Notebook which you can download and use in your own tenant.

I have to give credit to Peer Grønnerup for his blog post Fabric CLI Beyond Shell Commands which inspired my blog post.

Input Parameters

I started off with the Input Parameters as these are used multiple times in the Notebook.

NOTE: If needed I am sure that this could be adapted to loop through multiple workspaces, but in my example, I am using a single Workspace.

As explained in the code below I put in the relevant inputs

Installing the Fabric CLI

Next is where I installed the Fabric CLI

A screenshot of a computer error

AI-generated content may be incorrect.

I also then used my Azure Key Vault to get the service principal details and authenticate to Power BI / Fabric

If you want to understand how I did this please refer to this blog post: Using Sempy to Authenticate to Fabric/Power BI APIs using Service Principal and Azure Key Vault – FourMoo | Microsoft Fabric | Power BI

Next, I needed to enable the encryption fallback option to be able to successfully authenticate with Fabric CLI

And then finally using the Fabric CLI Python module I then logged in using Fabric CLI as shown below.

Getting all the Item Names in my workspace

Because I was now using the Fabric CLI the way that the data was returned was a little different and was returned in a byte’s object, so I had to then convert this into a dataframe as shown in the code below.

NOTE: All that I was interested in getting was the Item Name.

A screenshot of a computer program

AI-generated content may be incorrect.

Exporting to OneLake

The code below, which is not all the code, is where I exported the items to OneLake. This was way easier to get to work (With the help of my LLM 😊)

A screenshot of a computer

AI-generated content may be incorrect.

And here is the output in OneLake

A screenshot of a computer

AI-generated content may be incorrect.

Exporting to Azure Blob Storage

I then wanted to make sure I had another copy stored in Azure Blob Storage which is sperate to OneLake. And here is a code snippet below.

A screenshot of a computer program

AI-generated content may be incorrect.

Once I ran this code cell, I could then see the results in my Azure Storage container as shown below.

A screenshot of a computer screen

AI-generated content may be incorrect.

One thing I want to make a note of is when I am exporting the files there is an extra folder and when exporting to Azure Blob Storage there is an extra file for each folder that gets created.

To be honest this is where my Python capabilities are shown. So if anyone looks at the code and has a way to remove or improve the code please let me know, so that I can not only learn but let others also get the code.

Summary

In this blog post I have shown you how to successfully make a copy of all the supported Fabric items either to One Lake or Azure Blob Storage to ensure that all your items are backed up.

You could also schedule this so that it happens on a regular basis and you have up to date copies.

You can get a copy of the Notebook here: Fabric/Blog – Export all Items to OneLake.ipynb at main · GilbertQue/Fabric

Thanks for reading!