Microsoft DevOps Engineer Expert AZ-400 Practice Question
Your organization uses Azure Pipelines to deploy an ASP.NET Core application. Compliance rules require that any pipeline run that successfully deploys to the Prod environment must keep all build artifacts, logs, and test results for at least five years. All other runs can follow the default 30-day project retention policy. The multi-stage deployment pipeline is defined in YAML and must remain self-service for developers. You need an automated solution that meets the compliance requirement while minimizing storage costs for non-production runs. What should you recommend?
Define a retention policy in the pipeline's YAML that sets daysToKeep to 1,825 for all runs.
Create an Azure Artifacts feed with a 1,825-day retention policy and publish all build outputs as packages to that feed.
Set the project-level pipeline retention policy to 1,825 days.
Add a job in the production stage that invokes the Azure DevOps REST API to create a retention lease on the current run after a successful deployment.
A project- or pipeline-wide retention period would keep every run for five years, dramatically increasing storage consumption. Azure Artifacts retention policies cover only packages and do not preserve the entire pipeline run's logs or test results. Instead, the production stage can include a lightweight script or task that calls the Azure DevOps REST API to set the keepForever property to true for the current run. This action creates a retention lease that overrides normal cleanup policies, keeping the specific run and all of its artifacts indefinitely, while other runs continue to be deleted after 30 days.
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 a retention lease in Azure DevOps?
Open an interactive chat with Bash
How does the Azure DevOps REST API help in managing pipeline retention policies?
Open an interactive chat with Bash
Why is invoking the Azure DevOps REST API to set a retention lease a better option than increasing the project-wide retention policy?
Open an interactive chat with Bash
What is a retention lease in Azure DevOps?
Open an interactive chat with Bash
How do you use the Azure DevOps REST API to create a retention lease?
Open an interactive chat with Bash
What is the advantage of using REST API for pipeline retention over project-wide retention settings?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Design and implement build and release pipelines
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 .