Variable Libraries

Environment-specific configuration without changing code

The Problem with Hard-Coding

Your notebook works in Dev. You deploy to Prod. But the settings are wrong.

Dev

table = "workshop_seed_dev"
row_count = 10
label = "dev"
Deploy

Prod 💥

table = "workshop_seed_dev"
row_count = 10
label = "dev"

You could edit code per environment — but that defeats the purpose of automation. You need configuration that changes per stage, not code that changes per stage.

How Variable Libraries Work

One library, multiple value sets — each stage picks the right one

📦 EnvConfig
VariableDevProd
RunLabeldevprod
RowCount10100
TableNameseed_devseed_prod
Dev Workspace
Active: Dev value set
Prod Workspace
Active: Prod value set
  • Same code reads variables → gets different values per stage
  • Works with notebooks, pipelines, dataflows, shortcuts, and more

What You'll Do in Section 5

1
Create a variable library with Dev and Prod value sets
2
Update your notebook to read variables instead of hard-coded values
3
Deploy and set the active value set per stage
4
Run in Prod and verify different behavior, same code

Let's get started!