Data Bear

Fabric User Data Functions: Automate Workflows in Fabric

Power BI Box plots

Automating workflows in Microsoft Fabric just became more powerful thanks to User Data Functions (UDFs). Instead of manually orchestrating processes, you can now create reusable, customizable, and self-contained functions that connect to multiple Fabric services like SQL databases, lakehouses, and warehouses.

In this guide, we’ll walk through:

  • What Fabric User Data Functions are
  • How to enable and create them
  • Connecting to data sources in Fabric
  • Building a function that exports a DAG (Directed Acyclic Graph)
  • Automating execution with notebooks

By the end, you’ll see how UDFs simplify workflow automation and integration inside Fabric.

What Are Fabric User Data Functions?

User Data Functions (UDFs) are a preview feature in Fabric that let you host and run applications directly inside Fabric. Think of them as custom applications that encapsulate logic, connect to Fabric resources, and can be reused across your workflows.

Key Benefits
  • Reusability – Define logic once, use it anywhere
  • Customization – Tailor functionality to your business needs
  • Encapsulation – Keep everything self-contained in Fabric
  • External connectivity – Connect to data inside and outside Fabric
Step 1: Enable User Data Functions

Since this feature is in preview, you must enable it first:

  1. Go to the Admin portal in Fabric.
  2. Enable User Data Functions for either your entire organization or selected users.

Once enabled, you’re ready to create your first function.Enable User Data Functions

Step 2: Create Your First Fabric User Data Function

Inside your Fabric workspace:

  1. Click New Item → Search for Function.
  2. Choose User Data Function.
  3. Name your function (for example, thevideofunction).
  4. Click Create.

Fabric will generate a function with default settings, including a sample "Hello, World!" example that you can run immediately.Create Your First Fabric User Data Function

Step 3: Manage Connections

Most useful UDFs need to access data sources. From the Edit view:

  • Go to Manage Connections
  • Add connections to:
    • Lakehouses
    • Warehouses
    • SQL Databases in Fabric

Each connection generates an alias, which you can rename for clarity. These aliases let your function interact with multiple Fabric services.

Step 4: Build a Function That Exports a DAG

In Patrick’s example, the goal was to automate the creation of a DAG (Directed Acyclic Graph) used for notebook orchestration.

Here is the high-level process his UDF followed:

  1. Connect to the SQL Database and run a stored procedure that generates the DAG
  2. Fetch results and store them in a variable
  3. Apply formatting and adjustments
  4. Save the DAG JSON file into a specific Lakehouse folder
  5. Return output confirming success

This removes the need to manually copy DAG output into notebooks.

Step 5: Automate Execution in a Notebook

Once the DAG is saved to the Lakehouse, a notebook can:

  • Read the DAG file using Python utilities
  • Store its contents in a variable
  • Use the DAG to orchestrate notebook execution

This ensures the DAG is always up to date. Every time the stored procedure changes, you simply run the function and the updated DAG is ready for orchestration.

Step 6: Publish and Reuse Your Function

When your UDF is ready:

  1. Go to Home or Edit
  2. Click Publish

Your function will now be reusable within your workspace, callable from notebooks, or even from external applications using the generated invocation code.Publish and Reuse Your Function

Real-World Use Case: Automated ETL Workflows

Patrick’s example demonstrates how User Data Functions can become part of an ETL process:

  • Stored procedure updates graph relationships
  • UDF generates and exports the DAG file
  • Notebook consumes the DAG to orchestrate tasks

This creates a self-updating automation pipeline inside Fabric.

Conclusion

Fabric User Data Functions provide a powerful way to automate, encapsulate, and scale workflows inside Microsoft Fabric. Whether you are exporting DAGs, moving data between warehouses and lakehouses, or running custom applications, UDFs enable you to:

  • Simplify automation
  • Reduce manual work
  • Keep everything contained within Fabric

If you are exploring automation in Fabric, this feature can significantly improve your processes.

For more resources on Power BI and Fabric, explore Power BI Training with Data Bear.