Forum Discussion
Notebook parameterization: parameter cells vs pipeline base parameters vs Variable Library?
- 2 days ago
Hi jubinsoni,
I’d treat the three approaches as different layers rather than choosing only one.
For values that change per execution, I would use the notebook parameter cell. Microsoft’s notebook parameter guidance confirms that pipeline base parameters override the defaults in the parameter cell at runtime, which makes this a good fit for things like dates, source paths or run-specific flags.
For values that change by environment, I would prefer a Variable Library. Microsoft’s Variable Library guidance is specifically designed around dev/test/prod value sets, with one active value set per workspace.
I would keep config tables or JSON files for business configuration that is genuinely data-driven, such as thresholds, mappings or rules that users may maintain independently of deployment.
So my split would normally be:
- per-run values → notebook parameters
- per-environment values → Variable Library
- business rules/configuration → table or JSON
- secrets → Key Vault
One important limitation is that notebookutils.variableLibrary currently only works within the same workspace and does not support service principal execution. Microsoft also documents that the active value set is workspace state, so it is worth validating the correct value set in each deployment stage. (Variable Library utilities)For secrets, I would not store them in notebook parameters or Variable Libraries. Microsoft recommends using Azure Key Vault and retrieving them with NotebookUtils credentials.
So for promotion across workspaces, I’d use Variable Libraries for stable environment configuration and keep notebook parameters focused on values that genuinely change per run.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.
Hi jubinsoni,
I’d treat the three approaches as different layers rather than choosing only one.
For values that change per execution, I would use the notebook parameter cell. Microsoft’s notebook parameter guidance confirms that pipeline base parameters override the defaults in the parameter cell at runtime, which makes this a good fit for things like dates, source paths or run-specific flags.
For values that change by environment, I would prefer a Variable Library. Microsoft’s Variable Library guidance is specifically designed around dev/test/prod value sets, with one active value set per workspace.
I would keep config tables or JSON files for business configuration that is genuinely data-driven, such as thresholds, mappings or rules that users may maintain independently of deployment.
So my split would normally be:
- per-run values → notebook parameters
- per-environment values → Variable Library
- business rules/configuration → table or JSON
- secrets → Key Vault
One important limitation is that notebookutils.variableLibrary currently only works within the same workspace and does not support service principal execution. Microsoft also documents that the active value set is workspace state, so it is worth validating the correct value set in each deployment stage. (Variable Library utilities)
For secrets, I would not store them in notebook parameters or Variable Libraries. Microsoft recommends using Azure Key Vault and retrieving them with NotebookUtils credentials.
So for promotion across workspaces, I’d use Variable Libraries for stable environment configuration and keep notebook parameters focused on values that genuinely change per run.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.