We have a pretty common situation with a build pipeline and a deployment pipeline, where the build pipeline produces a build artifact (in our case, powershell and json files in a .zip) and a deployment pipeline uses that artifact (and a VM image) to deploy Azure resources (in our case, VMs).
We have a problem with the retention of the build artifacts, as in - they are – my theory – in the builds folder in azure and subject to retention rules there.
Artifact retention • Project settings
The problem is that older “artifacts” disappear with no explanation – and even though we have the base VM image still available, we can no longer created VMs for older versions of our software. Specifically, they disappear as options from this drop down in the deployment pipeline:
I thought that drop down is being fed from the list of files/artifacts available in the build or staging folder of the build pipeline. Recent research by fellow developers have disproved my theory. There is no documentation from Microsoft over what feeds that drop down and what controls the availability of artifacts there – though we suspect is still based somehow on the build pipeline. All the while, it seem that whilst using Azure pipelines, there is no way to keep older (in terms of either age or “# builds ago”) builds available for deployment – and this is simply hard to believe.
For Build Artifacts Retention:
As far as I know, three points can affect the retention time.
Days to keep artifacts, symbols and attachments
. This retention policy will keep artifacts for 30 days.If the policy is not overwritten, the artifacts will be deleted after 30 days
A single release: you could check this option in Release -> Retention
All Release: you could check it in Project Settings-> Release Retention
.
The artifacts retention policy will follow release retention policy.
Build -> Retain, Release -> Retain indefinitely
For example:
This Retain
option could keep the build forever.
If you want to keep the old artifacts , you could use this option.
Here is a doc about build and release retention policy.
For the Version Drop Down list:
The dropdown list shows the successful build versions. Whether it contains artifacts or not, they will be displayed in list.
The version corresponds to the build version number.
For example: