Skip to main content

Command Palette

Search for a command to run...

Pipeline Retention Policies and How To Retain Pipline Runs

🚀🗑️🔒

Updated
2 min read

Why do pipeline runs disappear and how can they be retained? This is related to the “retention policies” (see illustration). Azure DevOps checks these policies to decide when a pipeline run and the associated artifacts are deleted and how many runs are retained after the time has elapsed. These can be found under Project Settings -> Pipelines -> Settings.

However, there are ways to retain the results. On the one hand, this can be done directly from the web interface for a selected run via "Retain" (see illustration). On the other hand, this can be automated via pipeline tasks. Microsoft provides examples as PowerShell, Bash and REST API tasks for this purpose.

Note: Retained automatically, a run can only be held up to 731 days. If the results are needed for longer, they should be backed up, e.g. with the CopyFiles Task.

Furter information:

--- german | deutsch ---

Warum verschwinden Pipeline-Ergebnisse und wie lassen sie sich aufbewahren? Das hängt mit den sogenannten "Retention Policies" zusammen (siehe Abbildung). Anhand dieser entscheidet Azure DevOps, wann ein Pipeline-Run und die zugehörigen Artefakte gelöscht werden und wie viele Runs nach dem Ablauf der Zeit aufbewahrt werden. Diese finden sich unter Project Settings -> Pipelines -> Settings.

Es gibt jedoch Möglichkeiten, die Ergebnisse beizubehalten. Einerseits kann dies direkt in der Weboberfläche für einen ausgewählten Run über "Retain" (siehe Abbildung) erfolgen. Zum anderen kann dies automatisiert über Pipeline Tasks erledigt werden. Hierfür stellt Microsoft Beispiele als PowerShell, Bash und REST API Tasks zur Verfügung.

Hinweis: Automatisiert beibehalten wird der Run nur bis 731 vorgehalten. Falls die Ergebnisse länger benötigt werden, sollten diese gesichert werden, z.B. mit dem CopyFiles Task.

Weitere Informationen:

Azure DevOps Nuggets

Part 1 of 1

Welcome to our Azure DevOps Nuggets! Here you'll find valuable tips & tricks on different topics like work item management, repositories, and pipelines, along with useful links to enhance your Azure DevOps experience. Stay tuned!