Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Note
The Fabric variable library item is currently in preview.
Prerequisites
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:
Users can work with variable libraries
The tenant admin, capacity admin, or workspace admin can enable these switches, depending on your organization's settings.
Security considerations and permissions management for Fabric variable libraries
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.
Create a variable library item
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.
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.
Manage variable libraries and their variables
You can manage the variables in the variable library from the top menu bar.
Add a variable
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.
Delete or edit a variable
- 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.
Add a value set
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.
Edit a value set
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.
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.
Considerations and limitations
Size limitations
There can be up to 1,000 variables and up to 1,000 value sets, as long as you meet both of these requirements:
- The total number of cells in the alternative value sets is less than 10,000.
- The item's size doesn't exceed 1 MB.
These requirements are validated when you save changes.
The note field can have up to 2,048 characters.
The value-set description field can have up to 2,048 characters.
Limitations for alternative value sets
- Alternative value sets in a variable library appear in the order in which you added them. Currently, you can't reorder them in the UI. To change the order, edit the JSON file directly.
- The name of each value set must be unique within a variable library.
- Variable names must be unique within a variable library. You can have two variables with the same name in a workspace if they're in different items.
- There's always one (and only one) active value set in a variable library at a time. You can't delete a value set while it's active. To delete it, first configure another value set to be active. You can have a different active value set for each stage of a deployment pipeline.