Microsoft DevOps Engineer Expert AZ-400 Practice Question
An organization stores client secrets in Azure Key Vault and uses a YAML pipeline in Azure DevOps to deploy resources. Compliance mandates that:
Secrets must never appear in logs or artifacts.
Only tasks that require a secret may read it at runtime.
Build administrators must be unable to view or export the secret values from the Azure DevOps portal. Which design meets all requirements while keeping the pipeline definition entirely in Git?
Commit an encrypted JSON file containing the secrets to the repository and decrypt it during the build by using a GPG private key stored as a secure file.
Declare the secrets directly in the YAML file by using variables with the isSecret: true attribute and reference them in the tasks.
Call the AzureKeyVault@2 task in the job to download only the required secrets at runtime; reference the resulting secret variables in subsequent tasks.
Create a variable group in Azure DevOps, manually add each secret as a secret variable, and reference the group in the pipeline.
Using the AzureKeyVault@2 task downloads the required secrets during the job directly from Azure Key Vault. The secrets are exposed to the pipeline only as in-memory secret variables, which are automatically masked in logs and are not saved to artifacts. Because the values remain in Key Vault and are never stored in Azure DevOps, project or build administrators cannot later view them in the portal. Manually created secret variables (whether in a variable group or in YAML) are stored and can be viewed by anyone with edit privileges, and encrypted files checked into Git still expose the decryption key to the pipeline. Therefore, retrieving secrets just-in-time from Key Vault with AzureKeyVault@2 is the only option that satisfies every stated constraint.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Azure Key Vault and its role in securing secrets?
Open an interactive chat with Bash
How does the AzureKeyVault@2 task work in an Azure DevOps pipeline?
Open an interactive chat with Bash
Why is storing secrets as manual secret variables or encrypted files not compliant?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Develop a security and compliance plan
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .