AZ-400 · Question #439
Drag and Drop Question You have an Azure Pipeline. You need to store configuration values as variables. At which four scopes can the variables be defined, and what is the precedence of the variables f
The correct answer is job; stage; pipeline root; pipeline settings UI. In Azure Pipelines, variables can be defined at four scopes with the following precedence (highest to lowest): job, stage, pipeline root, and pipeline settings UI. A variable defined at a more specific/inner scope (like job) overrides the same variable defined at a broader/outer
Question
Exhibit
Answer Area
Drag items
Correct arrangement
- job
- stage
- pipeline root
- pipeline settings UI
Explanation
In Azure Pipelines, variables can be defined at four scopes with the following precedence (highest to lowest): job, stage, pipeline root, and pipeline settings UI. A variable defined at a more specific/inner scope (like job) overrides the same variable defined at a broader/outer scope (like pipeline root or pipeline settings UI), following the principle that the most local definition wins. The pipeline settings UI (variable groups or variables set in the Azure DevOps portal) has the lowest precedence and can be overridden by any inline variable definition in the YAML file.
Topics
Community Discussion
No community discussion yet for this question.
