Pipeline Variables and Templates Flashcards
7 cards from real AZ-400 practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Pipeline Variables and Templates flashcards as text
Which syntax do you use to reference a variable group linked to an Azure Key Vault in a YAML pipeline?
Answer: $(variableName)
Variables from Key Vault-linked variable groups are accessed using the macro syntax $(variableName) at runtime.
What is the purpose of the `extends` keyword in an Azure DevOps YAML pipeline?
Answer: To inherit from a base template and enforce organizational standards
The `extends` keyword allows a pipeline to inherit from a base template, enabling organizations to enforce mandatory steps and policies.
A pipeline template parameter is defined as `type: boolean`. What happens if you pass the string 'true' instead of the boolean true?
Answer: Azure DevOps automatically coerces the string to boolean true
Azure DevOps YAML performs automatic type coercion for boolean template parameters, so the string 'true' is treated as boolean true.
Which variable scope takes the lowest precedence when the same variable is defined at multiple levels in Azure Pipelines?
Answer: Pipeline root level
Variables defined at the pipeline root level have the lowest precedence and are overridden by stage, job, or step-level definitions.
How do you pass a secret variable from a parent pipeline to a template file without exposing it as plaintext?
Answer: Use the env: block in a step to map the secret to an environment variable
Secrets should be passed to template steps via the `env:` mapping, which prevents the value from appearing in logs.
What is the correct way to conditionally include a template step only when a parameter equals a specific value?
Answer: Use `${{ if eq(parameters.env, 'prod') }}:` wrapping the template include
Template expressions like `${{ if eq(parameters.env, 'prod') }}:` are evaluated at compile time and can conditionally include template steps.
Which statement correctly describes the `output` variable type in Azure Pipelines?
Answer: A step can set an output variable using `##vso[task.setvariable variable=name;isOutput=true]value`
Steps set output variables using the logging command `##vso[task.setvariable variable=name;isOutput=true]value`, making them available to downstream jobs.