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, streamlining content lifecycle management. This article explains how to create, manage, and consume Variable libraries.
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 must be enabled from the Admin portal:
- Users can create Fabric items
- Users can create variable libraries
These switches can be enabled by the tenant admin, capacity admin, or workspace admin, depending on your organization's settings.
Before you begin
Before you create a Variable library, make sure you understand who will have permission to access it.
Create a Variable library item
You can create a Variable library item from the Fabric home page or from inside your workspace.
From the side navigation bar, select Create (If it’s not there, select the three dots -> Create)
In the Data Factory section, select Variable library
Name the new Variable library and select Create. Make sure the name conforms to the required naming conventions.
An empty Variable library appears. You can now add variables to it.
Manage Variable library 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 it follows the naming conventions)
- Select a type from the drop-down list (See a list of supported variable types)
- Enter a default value
- Add a note explaining 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 select Delete variable and then Save.
- To edit the name, type, or value set of a variable, change the value and 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 all the variable names and values are valid. Any errors must be fixed before the changes are saved.
Add a value set
To add another value set that can be used in a different stage:
- Select Add value set
- Name the value set (make sure it follows the naming conventions) and give it a description (optional) of up to 2,048 characters.
- Select Set as active if you want to use this value to be the currently active value set in this workspace
- 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.
You have the following options:
- Set as active value set for this workspace
- Rename the value set
- Delete the value set
Select Save. Any changes only take effect after you save them.
To reset a variable 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 the total number of cells in the alternative value-sets is under 10,000 cells, and the item’s size not bigger than 1 MB. This is validated when the user saves changes.
- The note field can have up to 2,048 characters.
- The value-set description field can have up to 2,048 characters.
Alternative value set limitations
- Alternative value sets in the Variable library appear in the order they were added. 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 the 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 are in different items.
- There's always one and only one active value set in a Variable library at a time. You can't delete the active value set. To delete it, first set another value set to be active. You can set a different active value set for each stage of a deployment pipeline.