Skip to content

Instantly share code, notes, and snippets.

@weinong
weinong / remove-all-leases.sh
Created August 4, 2022 03:48
[Azure DevOps] remove all build retentions from a group of build definitions
#!/bin/bash
INF='\n'
USER=
TOKEN=
ORG=
PROJECT=
for definitionID in (91395 100391 91349 87035 95571 64773 79297 64580 63192 64774); do
for buildID in $(az pipelines build list --org https://dev.azure.com/${ORG}/ -p ${PROJECT} --definition-ids ${definitionID} -o json | jq -r ".[].id"); do