variable-library-cli

Manages Fabric Variable Library definitions, value sets, consumer references, and active value set state via REST APIs.

1.1k|301|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/microsoft/skills-for-fabric --skill variable-library-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: variable-library-cli
Source: https://github.com/microsoft/skills-for-fabric/tree/main/plugins/fabric-skills/skills/variable-library-cli
Command: npx skills add https://github.com/microsoft/skills-for-fabric --skill variable-library-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing Microsoft Fabric Variable Libraries requires juggling two separate planes: definition files serialized to Git (variables, defaults, value set overrides) and workspace item state (the active value set), plus knowing how each consumer item type references a variable. This Skill provides the exact REST endpoints, payload shapes, and gotchas so changes are made correctly the first time.

Core Features & Use Cases

  • Authoring mode: Create and update Variable Library definitions with variables.json, settings.json, and valueSets/<name>.json parts, using native JSON types for overrides and omitting the unsupported format field.
  • Consumption mode: Wire variables into pipelines (libraryVariables blocks), notebooks (notebookutils.variableLibrary), Dataflow Gen2, Copy Jobs, shortcuts, User Data Functions, and Airflow jobs with the correct reference syntax.
  • Operations mode: Read and switch the active value set per workspace via PATCH /variableLibraries/{id}, and understand Git serialization and CI/CD behavior with fabric-cicd.
  • Use Case: After deploying to a prod stage, point the prod workspace at the prod value set with a single PATCH call, then verify with GET /variableLibraries/{id} since the generic items endpoint omits properties.

Quick Start

Ask the assistant to create a Fabric Variable Library with dev and prod value sets and wire a variable into your pipeline.

Frequently Asked Questions about variable-library-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Fabric Variable Library with value sets via REST API?

Create a Variable Library by POSTing to /v1/workspaces/{ws}/items with type VariableLibrary and base64-encoded definition parts: variables.json, settings.json, and valueSets/<name>.json files. Omit the format field entirely, as Variable Library definitions reject it.

How do I reference a Variable Library variable in a Fabric pipeline?

Add a libraryVariables block under pipeline properties with libraryName, libraryId, variableName, and type, then reference it with the expression @pipeline().libraryVariables.<name>. The expression must be an object with type Expression, not a bare string.

Why doesn't my Git diff show the active value set change?

The active value set is workspace item state, not definition, so it is never serialized to Git. Verify it with GET /variableLibraries/{id}, which returns properties.activeValueSetName; the generic /items/{id} endpoint omits properties.

Why does my value set override fail with InvalidValueOrTypeMismatch?

Each variableOverrides value must use the variable's native JSON type, such as a real boolean or number, not a string. The REST documentation lists the field as String, but the live API rejects stringified booleans and numbers.

How do I read Variable Library values from a Fabric notebook?

Use notebookutils.variableLibrary.getLibrary("LibraryName") and access variables as properties, or call notebookutils.variableLibrary.get with the $(LibraryName/VariableName) path. Coerce Boolean values defensively with str(value).lower() == "true" since they may arrive as strings.

Should I use this CLI approach or fabric-cicd for Variable Library deployment?

Use the fabric-cicd Python package for full CI/CD deployment automation, as it supports VariableLibrary as an item type. Use direct REST calls for targeted tasks like creating a library or switching the active value set in one workspace.