<p>The interface is a little vague, but if I go to Pipeline &gt; Edit then click &quot;Retention&quot; at the top, I can set values there that work.</p>
<p>Note: The updates/clean up only happen at... some time???  I'm not 100% sure when, but builds aren't immediately cleaned up if the policy changes.</p>
<p>The Days to Retain a Release box and the Minimum Releases to Keep influence each other, and the system seems to keep the build if either meets the criteria.</p>
<p>So, I set the UAT stage to 1 day / 1 release, so it always keeps AT LEAST 1 build, and always keeps all builds for AT LEAST 1 day.</p>
<p>I set the Prod stage to 3 day / 3 release, so it always keeps AT LEAST 3 builds, and always keeps all builds for AT LEAST 3 days.</p>
<p>Now it's much cleaner:
<a href="https://i.sstatic.net/GD9Hy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GD9Hy.png" alt="Builds" /></a></p>
<p>I hope this helps someone in the future! :)</p>

CC BY-SA 4.0
2021-02-23T13:36:17.577Z
2021-02-23T13:36:17.577Z
Ezra Bailey
<p>I have several release pipelines that build to a UAT environment on a continuous integration.  They await deployment to Production on an approval.  A new release cancels the previous Production deployment.</p>
<p>Is there a way I can set retention so these deployments that will never be pushed to Production go away?  I'd like to still retain the previous production deployments for roll-back purposes.</p>
<p><a href="https://i.sstatic.net/uN1K2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uN1K2.png" alt="enter image description here" /></a></p>

<azure-devops><azure-pipelines><release-management>
Azure Dev Ops delete releases not going to production
Ezra Bailey
# Azure Dev Ops delete releases not going to production

(Asked by: username_0 on 2021-02-17)

I have several release pipelines that build to a UAT environment on a continuous integration. They await deployment to Production on an approval. A new release cancels the previous Production deployment.

Is there a way I can set retention so these deployments that will never be pushed to Production go away? I'd like to still retain the previous production deployments for roll-back purposes.

[![enter image description here](https://i.sstatic.net/uN1K2.png)](https://i.sstatic.net/uN1K2.png)

**Tags:** azure-devops, azure-pipelines, release-management


---

## 1 answers

### Answer by username_0 on 2021-02-23. Score: 2 | Accepted answer

The interface is a little vague, but if I go to Pipeline > Edit then click "Retention" at the top, I can set values there that work.

Note: The updates/clean up only happen at... some time??? I'm not 100% sure when, but builds aren't immediately cleaned up if the policy changes.

The Days to Retain a Release box and the Minimum Releases to Keep influence each other, and the system seems to keep the build if either meets the criteria.

So, I set the UAT stage to 1 day / 1 release, so it always keeps AT LEAST 1 build, and always keeps all builds for AT LEAST 1 day.

I set the Prod stage to 3 day / 3 release, so it always keeps AT LEAST 3 builds, and always keeps all builds for AT LEAST 3 days.

Now it's much cleaner:
[![Builds](https://i.sstatic.net/GD9Hy.png)](https://i.sstatic.net/GD9Hy.png)

I hope this helps someone in the future! :)


---

