| title | Get Started with Variable Libraries |
|---|---|
| description | Learn how to manage Microsoft Fabric variable libraries to customize and share item configurations in a workspace. |
| ms.reviewer | NimrodShalit |
| ms.topic | quickstart |
| ms.date | 12/15/2025 |
| ms.search.form | Create and use variable library |
Microsoft Fabric variable libraries enable developers to customize and share item configurations within a workspace, with a goal of streamlining content lifecycle management. This article explains how to create, manage, and consume variable libraries.
For a more detailed walkthrough of the process, see the tutorial for using variable libraries.
To create variable library items in Fabric, you need:
-
A Fabric tenant account with an active subscription. Create an account for free.
-
The following tenant switches enabled from the Admin portal:
The tenant admin, capacity admin, or workspace admin can enable these switches, depending on your organization's settings.
Fabric variable libraries are powerful constructs that enable centralized management of variables across multiple Fabric items. However, this flexibility introduces critical security considerations.
Because variable libraries themselves are Fabric items, they're governed by their own permission sets. These permission sets might differ from those of the items that consume their variables. This discrepancy can lead to scenarios where a user has write access to a variable library but lacks any access to the consuming item.
In such cases, unauthorized users can modify variable values in ways that intentionally or unintentionally alter the behavior of dependent Fabric items. This ability creates a potential attack vector where malicious updates to shared variables could compromise the integrity, security, or functionality of those items.
To mitigate these risks, follow these key practices:
- Adopt strict permission controls: Administrators must carefully manage write permissions on variable libraries so that only trusted users or services can modify them. This practice includes avoiding overly permissive access and regularly auditing permission assignments.
- Use trusted library references: Items should reference variables only from libraries that are explicitly designated as trusted. This trust model should be enforced through governance policies that validate the source of variable references during development and deployment.
For more information, see Variable library permissions.
The name of a variable library item itself must follow these conventions:
- Isn't empty
- Doesn't have leading or trailing spaces
- Starts with a letter
- Can include letters, numbers, underscores, hyphens, and spaces
- Doesn't exceed 256 characters in length
The variable library name is not case sensitive.
You can create a variable library item from the Fabric home page or from inside your workspace:
-
On the sidebar, select Create. (If it's not there, select the three dots, and then select Create.)
-
In the Data Factory section, select Variable library.
:::image type="content" source="./media/get-started-variable-libraries/create-from-home.png" alt-text="Screenshot of the Fabric interface that shows the location of variable libraries in the data factory section." lightbox="./media/get-started-variable-libraries/create-from-home.png":::
-
Name the new variable library and then select Create. Make sure that the name conforms to the required naming conventions.
-
Select + New item.
-
Scroll down to the Develop data section and select Variable library.
:::image type="content" source="./media/get-started-variable-libraries/create-from-workspace.png" alt-text="Screenshot of the Fabric interface for creating a variable library item from an existing workspace." lightbox="./media/get-started-variable-libraries/create-from-workspace.png":::
-
Name the new variable library and then select Create. Make sure that the name conforms to the required naming conventions.
An empty variable library appears. You can now add variables to it.
:::image type="content" source="./media/get-started-variable-libraries/empty-variable-library.png" alt-text="Screenshot of an empty variable library with a button for a new variable.":::
You can manage the variables in the variable library from the top menu bar.
:::image type="content" source="./media/get-started-variable-libraries/add-variable.png" alt-text="Screenshot of a variable library, with a button for creating a new variable on the menu bar.":::
To add a new variable to the library:
- Select + New variable.
- Enter a name. Make sure that it follows the naming conventions.
- In the dropdown list, select a type. See a list of supported variable types.
- Enter a default value.
- Add a note that explains what the variable is for or how to use it (optional).
- Select Save.
- To delete a variable, select one or more variables and then select Delete variable > Save.
- To edit the name, type, or value set of a variable, change the value and then select Save.
- To add another alternative value set, select Add value set.
Note
Selecting Save after editing any variable in the variable library triggers an error validation check to make sure that all the variable names and values are valid. You must fix any errors before you save the changes.
To add another value set that you can use in a different stage:
-
Select Add value set.
-
Name the value set. Make sure that it follows the naming conventions. Give it a description (optional) of up to 2,048 characters.
-
If you want to use this value to be the currently active value set in this workspace, select Set as active.
-
Enter values for all the variables in the variable library.
-
Select Save.
To edit a value set:
-
Select the three dots next to the name of the value set.
-
Select Set as active (for this workspace), Rename, or Delete.
:::image type="content" source="./media/get-started-variable-libraries/edit-value-set.png" alt-text="Screenshot of the options for editing a value set: set as active, rename, and delete.":::
-
Select Save. Changes take effect only after you save them.
To reset the value of each variable to the default value, select the reset button.
:::image type="content" source="./media/get-started-variable-libraries/reset-to-default.png" alt-text="Screenshot of a variable library that shows a reset button next to each value of a variable.":::
[!INCLUDE limitations]