How to create and install custom Python libraries in Microsoft Fabric

Feb 06, 20246,077 views13:30

In this video, we'll walk through how to create and install your own custom Python libraries within Microsoft Fabric. We'll start with some original code, then show you how to package it up so you can reuse it across different notebooks. We'll also demonstrate how to install the package and use it to fetch secrets from Azure Key Vault, helping you keep your code clean and organized.

Open in YouTube

Description

You've probably used %pip install to include open source libraries in your Fabric notebooks, but did you know you can also easily install your own custom Python libraries? This end-to-end walk through shows you how to create and package your own code in custom libraries in a Fabric Lakehouse. Packaging your code in libraries encourages reusability and reduces the need to paste commonly used code snippets into every new notebook. The demo scenario uses a custom library to package code that fetches secrets from Azure Key Vault into my Python notebooks. See my blog for additional info and source code: https://robkerr.ai/fabric-custom-libraries 0:00 Introduction 1:19 Orgininal Code Cell 2:41 Create the Python Package 6:24 Microsoft Docs 7:16 Install the Package 8:09 Run the Package 11:07 Shortcuts 12:58 Summary