variable-library-cli

Create, wire, and operate Microsoft Fabric Variable Library items via the Fabric REST API.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/paulasilvatech/Fabric-Agentic-SDLC --skill variable-library-cli-paulasilvatech
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: variable-library-cli
Source: https://github.com/paulasilvatech/Fabric-Agentic-SDLC/tree/main/.github/skills/variable-library-cli
Command: npx skills add https://github.com/paulasilvatech/Fabric-Agentic-SDLC --skill variable-library-cli-paulasilvatech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing Microsoft Fabric Variable Libraries through the REST API involves subtle pitfalls: wrong definition part names, stringified override values that the API rejects, confusion between definition edits and active value set state, and incorrect consumer wiring. This Skill encodes the verified endpoints, payload shapes, and gotchas so Variable Library operations succeed on the first attempt. ## Core Features & Use Cases - Definition authoring: Create or update Variable Library items with variables.json, settings.json, and valueSets/<name>.json parts using base64-encoded updateDefinition calls, with correct native JSON types for overrides. - Consumer wiring: Generate the Variable Library side of references for pipelines (libraryVariables), notebooks (notebookutils.variableLibrary), Dataflow Gen2, copy jobs, shortcuts, User Data Functions, and Airflow jobs. - Active value set operations: Read and switch the active value set per workspace or deployment stage via GET/PATCH on /variableLibraries/{id}, and explain Git serialization and CI/CD behavior. - Use Case: After deploying to a prod stage, point the prod workspace at the prod value set with a single PATCH call, then verify the change landed by reading back properties.activeValueSetName. ## Quick Start Ask the AI to create a Variable Library named AppConfig with dev and prod value sets in your Fabric workspace, or to wire an existing variable into a pipeline or notebook.

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 Variable Library in Microsoft Fabric via REST API?▼

Create a Variable Library by POSTing to /v1/workspaces/{ws}/items with type VariableLibrary and a definition containing base64-encoded parts: variables.json, settings.json, and optional valueSets/<name>.json files. Omit the format field entirely, and handle the 202 response with LRO polling.

How do I set the active value set for a Fabric Variable Library?▼

Set the active value set with PATCH /v1/workspaces/{ws}/variableLibraries/{id} and a body of {"properties":{"activeValueSetName":"<name>"}}. This changes workspace item state only; it does not edit definition files or appear in a Git diff.

How do I use Variable Library values in a Fabric pipeline?▼

Add a libraryVariables block under pipeline properties with libraryName, libraryId, variableName, and type, then reference it with the expression object {"value": "@pipeline().libraryVariables.x", "type": "Expression"}. Map Boolean to Bool and Integer to Int; Number is not supported in pipelines per Microsoft Learn.

Why does my Variable Library updateDefinition fail with InvalidValueOrTypeMismatch?▼

This error occurs when a value set variableOverrides[].value is a string for a Boolean, Integer, or Number variable. Use the variable's native JSON type (false, 1000000) instead of a string, even though the REST documentation lists the field as String.

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

The active value set is workspace item state, not part of the serialized definition, so it never appears in Git. Verify it with GET /variableLibraries/{id}, since the generic /items/{id} endpoint omits the properties block.

How do I read a Boolean Variable Library value in a Fabric notebook?▼

Read it with notebookutils.variableLibrary.getLibrary("name") or the $(/**/Library/Variable) path, then coerce defensively with str(value).lower() == "true". Never use bool(value), because the string "false" is truthy in Python.