AZ-400 Pipeline Variables and Templates — Questions and Answers
Question 1: What are pipeline variables used for in Azure DevOps?
- Replacing code files
- Storing configurable values used across pipeline stages (Correct answer)
- Deleting old pipelines
- Managing user permissions
Correct answer: Storing configurable values used across pipeline stages
Pipeline variables store configurable values that can be used across different stages and tasks in a pipeline.
Question 2: What is a pipeline template in Azure DevOps?
- A pre-built application
- A reusable pipeline definition that can be shared across projects (Correct answer)
- A monitoring tool
- A test framework
Correct answer: A reusable pipeline definition that can be shared across projects
Pipeline templates define reusable pipeline configurations that can be referenced and extended across multiple pipelines and projects.
Question 3: Which variable scope applies to all stages in an Azure DevOps pipeline?
- Stage-level variables
- Job-level variables
- Pipeline-level variables (Correct answer)
- Task-level variables
Correct answer: Pipeline-level variables
Pipeline-level variables are accessible across all stages and jobs within the entire pipeline execution.
Question 4: How are secret variables handled in Azure DevOps pipelines?
- They are displayed in logs
- They are encrypted and masked in log output (Correct answer)
- They are stored in plain text
- They cannot be used
Correct answer: They are encrypted and masked in log output
Secret variables are encrypted at rest and automatically masked in log output to prevent accidental exposure of sensitive data.
Question 5: What is the benefit of using variable groups in Azure DevOps?
- They slow down pipelines
- They allow sharing variables across multiple pipelines (Correct answer)
- They replace environment variables
- They delete old variables
Correct answer: They allow sharing variables across multiple pipelines
Variable groups allow you to define a set of variables once and share them across multiple pipelines, ensuring consistency.
Question 6: What is a conditional expression in Azure DevOps YAML pipelines?
- A build error
- A logic statement that controls whether a step runs based on conditions (Correct answer)
- A variable type
- A deployment target
Correct answer: A logic statement that controls whether a step runs based on conditions
Conditional expressions evaluate conditions at runtime to determine whether specific pipeline steps or stages should execute.
What are pipeline variables used for in Azure DevOps?