AZ-400 ยท Maintaining pipelines
Retention of artifacts and dependencies
Retention policies for runs, artifacts, logs and releases, pipeline artifact vs build artifact lifetime, retain-for-release, GitHub Actions artifact and log retention, feed retention.
Key points
- Azure DevOps run retention: per project (Project settings, Pipelines, Settings); no per-pipeline rules.
- Deleting a run removes logs, pipeline and build artifacts, symbols, test results, but not feed packages.
- A run is kept if marked for indefinite retention, held by a release, or among recent runs.
- Classic releases have their own settings.
- Keep longer: copy to your own storage.
- GitHub Actions: 90 days by default, adjustable.
Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/policies/retention?view=azure-devops
Practice questions
Where do you configure run retention for both YAML and classic build pipelines in Azure DevOps Services?
- In each pipeline's YAML under a retention: key
- In Project settings, Pipelines, Settings
- In the agent pool capabilities
- In the Azure Artifacts feed permissions
Show answer
Answer: B. In Project settings, Pipelines, Settings
Per-pipeline retention rules are no longer supported; run retention lives in Project settings under Pipelines, Settings. The other places do not control run retention.
Which items are removed when Azure Pipelines deletes a run under the retention policy?
- Run logs
- Pipeline and build artifacts
- Test results
- Universal Packages in a feed
- Git commits built by the run
Show answer
Answer: A. Run logs, B. Pipeline and build artifacts, C. Test results
Logs, pipeline and build artifacts, and test results are deleted with the run. Run retention does not govern packages in Azure Artifacts feeds, and Git commits stay in the repository.
Pipeline run retention policies also delete the NuGet and npm packages stored in Azure Artifacts feeds.
Show answer
Answer: False
False. Run retention does not govern Universal Packages, NuGet, npm and other packages; feeds have their own retention settings.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
