AZ-400 Practice Question: Design and implement build and release pipelines
You need to implement a strategy to manage secrets for your multi-stage YAML pipeline. The pipeline runs on Microsoft-hosted agents. Which approach should you use to securely pass secrets to pipeline tasks?
⚠ Common exam trap
Test-takers frequently confuse secret variables with environment variables or assume that Azure Key Vault integration requires a separate task to pass secrets as parameters, when in fact secrets are automatically mapped as pipeline variables and referenced with `$(variableName)`.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use pipeline variables with 'secret: true' and reference them as $(variableName).
Azure Pipelines supports secret pipeline variables that are encrypted at rest and never exposed in logs or output. By defining a variable with `secret: true` in the YAML or via the UI, you can reference it securely as `$(variableName)` in tasks, ensuring the secret value is masked during execution.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Define the secrets as environment variables in the pipeline YAML directly.
Why it's wrong here
This would expose the secret in the YAML.
- ✗
Use the Azure Key Vault task to download secrets and then pass them as parameters.
Why it's wrong here
Secrets should be mapped to variables, not parameters.
- ✓
Use pipeline variables with 'secret: true' and reference them as $(variableName).
Why this is correct
Secret variables are encrypted and masked in logs.
- ✗
Store secrets in a file in the repository and read it during the build.
Why it's wrong here
Storing secrets in the repo is insecure.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Variables
A variable is a named storage location in a computer program that holds a value which can change during execution.
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
About these practice questions
One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.