AzureDevOps project Severitylow builtIn

Description

Retention policy - Number of recent runs to retain per pipeline (>= 3). This many runs will also be retained per protected branch and default pipeline branch. (Azure Repos only).

Recommendation

1. Navigate to Project Settings. 
2. Open the Settings link under Pipelines. 
3. Set the number of recent runs to keep for each pipeline.

Policy Rule

{
  "target": "ADOProjectPipelineRetentionSettings",
  "if": {
    "allOf": [
      {
        "resource": "ADOProjectPipelineRetentionSettings",
        "property": "RetainRunsPerProtectedBranch.Value",
        "operator": "greaterThan",
        "value": 2
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}