Edit

Share via


Variable library integration with pipelines

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

How to use Variable library with pipelines

  1. Navigate to your workspace and create a new item.

    Screenshot showing where to add a new item in your Fabric workspace highlighted.

  2. Use the filter to find Variable library or scroll down to the Develop data section.

    Screenshot showing the filter for a new Variable library item.

  3. Select Variable library to create a new Variable library. Choose a name and hit Create.

    Screenshot showing a new Variable library item with a name set and the Create button highlighted.

  4. Once the Variable library is created, you are taken to the homepage. Click + New to add a new variable.

    Screenshot showing the start page for a new Variable library item.

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

    Screenshot showing the configurations to set for a new variable.

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

    Screenshot highlighting where to add new value sets for a variable.

    Screenshot showing how to add a name for a new value set.

  7. Save your changes once you're done.

Screenshot showing the Save button highlighted in the top left corner.

Use Variable library variables in your pipeline

  1. To use a Variable library variable in your pipeline, create a new pipeline or navigate to an existing pipeline.

    Screenshot highlighting the create new item button in the top left corner and the pipeline item highlighted.

  2. In your pipeline, you need to create a reference to your variable library variable in the bottom panel.

    Screenshot highlighting the Library variables tab and the +New button in the bottom panel of the pipeline canvas.

  3. After you click + New, a pop-up will open that shows you all your Variable libraries. You can use this picker to select your Variable library variable and click Ok.

    Screenshot showing the +New button in the Library variable tab highlighted.

    Screenshot showing a Library variable selected in the variable picker.

    Screenshot showing the configuration set for a new Library variable reference.

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

    Screenshot showing Add dynamic content highlighted in the settings of a Lookup activity.

  5. The expression builder opens. If you don't see Library variables, click the 3 dots next to Functions and select Library variables.

    Screenshot showing the 3 dots next to Functions in the expression builder and the Library variables tab highlighted.

  6. Click on your Library variable reference to add a new expression to the expression builder. Then, click Ok to add your expression.

    Screenshot showing a Library variable reference highlighted to be added to the expression builder.

    Screenshot showing the expression set in the expression builder.

  7. You'll now see that the dynamic content is added to your activity setting.

    Screenshot showing the expression set as dynamic content in the Lookup activity settings.

  8. You can preview your data by clicking Preview data. This will open a new pane that shows the value of your library variable. Click Ok to get a preview of your data.

    Screenshot showing the preview data option.

    Screenshot showing the preview data pane.

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

    Screenshot showing the Save and Run settings highlighted on the pipeline canvas.

Known limitations

The following known limitations apply to the integration of Variable library in pipelines in Data Factory in Microsoft Fabric:

  • The Variable library supports Boolean, Datetime, Guid, Integer, Number, and String as data types. In your 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 pipelines.
  • External connection parameterization is supported with variable library integrated with 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 selecting Settings next to your connection name.