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.
The Variable library is a new item type in Microsoft Fabric that allows users to define and manage variables at the workspace level, so they could soon be used across various workspace items, such as data pipelines, notebooks, Shortcut for lakehouse and more. It provides a unified and centralized way to manage configurations, reducing the need for hardcoded values and simplifying your CI/CD processes, making it easier to manage configurations across different environments.
Note
Variable library and its integration with data pipelines is currently in public preview.
How to use Variable library with data pipelines
Create a Variable Library
Navigate to your workspace and create a new item.
Use the filter to find Variable library or scroll down to the Develop data section.
Select Variable library (preview) to create a new Variable library. Choose a name and hit Create.
Once the Variable library is created, you are taken to the homepage. Click + New to add a new variable.
Once you add a new variable, you can configure your variable and set the Name, Type, and Default value set. You can also add Notes.
Add Alternative value sets as you need (for example, different values for different deployment pipeline environments). After you set a name and click Create, you can edit the variable values and choose value set to make active.
Save your changes once you're done.
Use Variable library variables in your pipeline
To use a Variable library variable in your pipeline, create a new pipeline or navigate to an existing pipeline.
In your data pipeline, you need to create a reference to your variable library variable in the bottom panel.
After you click + New, you'll need to add a name for your variable reference, then use the drop-down to select your Variable library and Variable name in your Variable library.
Once you have added your library variable references, add your pipeline activities. In the activity settings, click Add dynamic content for the setting you want to parameterize.
The expression builder opens. If you don't see Library variables (preview), click the 3 dots next to Functions and select Library variables (preview).
Click on your Library variable reference to add a new expression to the expression builder. Then, click Ok to add your expression.
You'll now see that the dynamic content is added to your activity setting.
Save and run your pipeline as you normally would. You'll see that the value passed is whatever value is set as Active in your Variable library.
Known limitations
The following known limitations apply to the integration of Variable library in pipelines in Data Factory in Microsoft Fabric:
- It is required for you to set a name for your variable reference within the pipeline canvas in order to use your Variable library variables in data pipeline. Unique names must be set for your variable references.
- The Variable library supports Boolean, Datetime, Guid, Integer, Number, and String as data types. In your data pipeline, you will see Boolean as Bool type, Datetime as String type, Guid as String type, Integer as Int type, and String as String type. Number types are not supported in data pipelines.
- External connection parameterization is supported with variable library integrated with data pipelines. However, you must look up the GUID for your connection from Settings | Manage connections and gateways. There you will find the GUID for your connection by clicking Settings next to your connection name.
- If you choose to parameterize with a library variable, you will not be able to preview your data or use the drop-down selection to see existing tables or files.
- Currently, you're unable to view what value is set for the variable library variable in the pipeline canvas prior to running the pipeline.
- If you make changes in your Variable Library, you might not see new variables or changes to your existing data pipeline references immediately. If that happens, close your pipeline and re-open it.