Edit

Share via


Create and manage Variable libraries (preview)

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:

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.

  1. From the side navigation bar, select Create (If it’s not there, select the three dots -> Create)

  2. In the Data Factory section, select Variable library

    Screenshot of UI showing the location of variable libraries in the data factory section.

  3. 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.

Screenshot of an empty Variable library. It says there are no variables, and there's a green button that says New variable.

Manage Variable library and their variables

You can manage the variables in the Variable library from the top menu bar

Screenshot of a Variable library. On top, there's a button that says New variable.

Add a variable

To add a new variable to the library:

  1. Select + New variable
  2. Enter a name (make sure it follows the naming conventions)
  3. Select a type from the drop-down list (See a list of supported variable types)
  4. Enter a default value
  5. Add a note explaining what the variable is for or how to use it (optional)
  6. 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:

  1. Select Add value set
  2. Name the value set (make sure it follows the naming conventions) and give it a description (optional) of up to 2,048 characters.
  3. Select Set as active if you want to use this value to be the currently active value set in this workspace
  4. Enter values for all the variables in the Variable library
  5. Select Save

Edit a value set

To edit a value set, select the three dots next to the name of the value set.

Screenshot of the edit value set options. There are three options, set as active, Rename, and Delete.

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.

Screenshot of a Variable library. There's a reset button next to the value of a variable.

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.