I have builds set up in Azure DevOps 2019 and my builds are generated using yml. I have so many builds that I do not need them so. I have setup my release retention policy to 30 days which works fine. How ever I am interested in deleting the old build and it doe snot have effect on them. Where and how can I setup the retention policy to delete builds. I could not find any place from the left hand navigation in the azure devops or on the build page.
Asked
Active
Viewed 909 times
1 Answers
2
In Azure Devops server 2019, it doesn't support configure retention policies for YAML pipelines. The default retention for all YAML builds to 30 days.
But this feature has been supported in Azure DevOps Server 2020. To configure retention policies for YAML and classic pipelines is through the project settings. You may consider upgrade your sever from 2019 to 2020.

Cece Dong - MSFT
- 29,631
- 1
- 24
- 39
-
Unfortunately I can not upgrade as this managed by another group and there might be down stream applications. But interestingly I do not even see my older builds (more than 30 days) getting deleted after 30 days in Azure 2019 :( any insight? – user464291 Nov 23 '20 at 15:45
-
Are the builds linked to any deployments? You could try to call [Builds - Get](https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/get?view=azure-devops-server-rest-5.0) REST API to get a build and check the values of keepForever and retainedByRelease. – Cece Dong - MSFT Nov 24 '20 at 10:05
-
Some are and some don't. Build could for any branch not only master as I was trying to test and fix the build multiple time before finalize it. Also some builds result were deployed to Dev and UAT. Where do I put the code? It is not part of a build and also not part of release step. I am excepting at least after 30 days the builds get deleted with retention policy and i do not need to do coding as you mentioned. Have you ever seen that this retention policy works in 2019 with build older than 30 days by any chance? It is strange that it does not – user464291 Nov 24 '20 at 15:56
-
Thank you Cece as you mentioned it deleted the build older than 30 days. I did a clean up and It is working. Thanks for your help – user464291 Nov 24 '20 at 16:33
-
Great to see your issue is solved. You could [Accept my reply as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), this can be beneficial to other community members reading this thread. – Cece Dong - MSFT Nov 25 '20 at 00:55