Compare variables, variable groups, runtime parameters and secrets in Azure Pipelines.
AdvancedConceptAzure DevOps, Bicep and Terraform
Answer
- Variables:
$(name)macro,${{ variables.name }}compile-time,$[ variables.name ]runtime expression. Can be set from a script:echo "##vso[task.setvariable variable=tag;isOutput=true]v1". - Variable groups: shared across pipelines in Library; can be linked to Key Vault so secrets are fetched at runtime.
- Parameters: typed, evaluated at compile time, show up as inputs at queue time; they can't change during the run.
- Secrets: masked in logs, not exposed to scripts as env vars unless mapped explicitly (
env: { DB_PASS: $(dbPass) }), and not available to fork PR builds.
More on Azure DevOps, Bicep and Terraform
What services make up Azure DevOps?BeginnerWhat are branch policies in Azure Repos?BeginnerExplain the YAML pipeline structure in Azure Pipelines.BeginnerWhat are service connections and how should they authenticate?IntermediateWhat are environments in Azure Pipelines?IntermediateWhat deployment strategies do deployment jobs support?Intermediate