AZ-400 Practice Question: Design and implement build and release pipelines
Your release pipeline uses deployment groups to deploy to Windows servers. You need to securely pass credentials to a script that runs on target machines. What is the recommended approach?
⚠ Common exam trap
Many candidates choose Option B (pipeline variables) thinking they are secure because they can be marked as secret, but they lack the centralized management, rotation, and access control that Azure Key Vault provides, which is the recommended approach for production secrets.
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 Azure Key Vault task to fetch secrets during deployment
The Azure Key Vault task securely retrieves secrets (e.g., passwords) from an Azure Key Vault during deployment, avoiding hardcoded or exposed credentials. This integrates with Azure Pipelines to pass secrets to scripts without storing them in the pipeline or on target machines, adhering to least-privilege and secure secret management practices.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Hardcode credentials in the script and encrypt the script file
Why it's wrong here
Hardcoding credentials in the script and using file encryption is fundamentally flawed because the secret is static, stored in the script or source control, and reversible encryption can be defeated if the key is compromised, offering no strong protection.
- ✗
Store credentials as pipeline variables and reference them
Why it's wrong here
Pipeline variables, even when marked as secret, are stored in plaintext within the pipeline definition or variable groups and are exposed as environment variables to every task during execution. This makes them vulnerable to accidental disclosure through task logs, debug output, or inline scripts that echo variable values, and they lack fine-grained access control or an audit trail of who retrieved them. Moreover, secrets stored this way are static and not centrally managed, so rotating them requires manual updates across multiple pipelines and poses a high risk of credential sprawl.
- ✓
Use Azure Key Vault task to fetch secrets during deployment
Why this is correct
The Azure Key Vault task securely retrieves secrets from Key Vault at deployment time and injects them as variables, ensuring that credentials are not stored in the pipeline or exposed in logs while centralizing access and enabling rotation.
- ✗
Use environment variables on the target machines
Why it's wrong here
Environment variables on target machines are readable by any user or process running on that host, and they persist indefinitely, making them a persistent attack surface if the machine is compromised. Managing credentials this way requires manual, per-machine configuration, leading to configuration drift and inconsistent secret values across the deployment group. There is also no centralized access control, no rotation mechanism, and no auditable record of access, which violates security best practices and compliance requirements for secret management.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Release pipeline
A Release pipeline is an automated sequence of steps that takes software from code commit to production deployment, ensuring quality and consistency.
Key term
Azure Key Vault
Azure Key Vault is a cloud service for securely storing and managing sensitive information like passwords, encryption keys, and certificates.
About these practice questions
Courseiva writes every AZ-400 question from scratch — 823 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.