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

Pré-requisitos

To create Variable library items in Fabric, you need:

Antes de começar

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.

Adicionar uma variável

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

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.

Observação

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

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.

Você tem as seguintes opções:

  • Set as active value set for this workspace
  • Rename the value set
  • Delete the value set

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

Considerações e limitações

Limitações de tamanho

  • Pode haver até 1.000 variáveis e até 1.000 conjuntos de valores, desde que o número total de células nos conjuntos de valores alternativos seja inferior a 10.000 células e o tamanho do item não seja maior que 1 MB. Isso é validado quando o usuário salva as alterações.
  • O campo de notas pode ter até 2.048 caracteres.
  • O campo de descrição do conjunto de valores pode ter até 2.048 caracteres.

Limitações do conjunto de valores alternativos

  • Os conjuntos de valores alternativos na biblioteca de variáveis aparecem na ordem em que foram adicionados. Atualmente, não é possível reordená-los ou alterar sua ordem na interface do usuário. Para alterar a ordem, edite o arquivo JSON diretamente.
  • O nome de cada conjunto de valores deve ser exclusivo dentro da biblioteca de variáveis.
  • Os nomes de variáveis devem ser exclusivos dentro de uma biblioteca de variáveis. Você pode ter duas variáveis com o mesmo nome em um espaço de trabalho se elas estiverem em itens diferentes.
  • Há sempre um e apenas um valor ativo definido em uma biblioteca de variáveis de cada vez. Não é possível excluir o conjunto de valores ativo. Para excluí-lo, primeiro defina outro valor definido como ativo. Você pode definir um conjunto de valores ativos diferente para cada estágio de um pipeline de implantação.