AZ-400 Question 212
Select 2Your organization uses Azure DevOps to build and deploy an application across multiple environments. The build pipeline produces artifacts that are consumed by a release pipeline. Because of your compliance requirements, you must keep production release artifacts for 90 days, while build artifacts can expire after 14 days to save storage costs. You also want to automatically remove stale artifacts to avoid manual processes. Which two actions should you take to meet these requirements?
- A
Configure a default retention policy of 14 days in Azure DevOps Project Settings, then override the retention settings in the release pipeline to 90 days for production artifacts.
- B
Enable 'Keep Forever' for the build pipeline to ensure artifacts never get cleaned up, guaranteeing availability for compliance.
- C
Manually delete the production release artifacts from the pipeline after 90 days using a scheduled job.
- D
Configure an organization-wide retention policy of 30 days, relying on manual extension for production artifacts as needed.
- E
Create two different pipelines: one for non-production releases with 14-day retention, and one for production releases with 90-day retention.
Show answer and explanation
Correct answers: A, E
Explanation
Azure DevOps supports automatic artifact cleanup via configurable retention policies at both the project and pipeline levels. Option 1 demonstrates using a shared default retention policy for short-lived artifacts while overriding for specific pipelines (such as production releases) to meet longer retention requirements. Option 5 illustrates separating pipelines to apply distinct retention policies. Both strategies are valid and help avoid manual processes while ensuring compliance with organizational or regulatory needs. For more information, refer to Microsoft� documentation on Azure DevOps pipeline retention policies.
- A. Correct.
Correct. Setting a short default retention (14 days) meets the need for build artifacts while overriding specifically for the production release pipeline to 90 days ensures compliance. This leverages Azure DevOps pipeline settings so you can automate artifact cleanup without manual intervention.
- B. Incorrect.
Incorrect. 'Keep Forever' prevents artifacts from ever being deleted, which wastes storage and does not address the 14-day requirement for build artifacts. While it could satisfy compliance, it contradicts storage efficiency goals.
- C. Incorrect.
Incorrect. Relying on manual deletion can introduce errors and inconsistencies. Azure DevOps supports automated retention policies, so scheduling manual cleanup is less efficient and prone to oversight.
- D. Incorrect.
Incorrect. Configuring a single organization-wide policy of 30 days does not satisfy the explicit 90-day retention requirement for production release artifacts and would violate compliance needs.
- E. Correct.
Correct. Splitting pipelines allows you to apply separate retention policies: a 14-day policy for non-production and a 90-day policy for production. This ensures compliance without needless artifact retention for temporary builds.