Powershell Script to download all Azure DevOps Git repositories using Git clone or pull.
Azure DevOps Extension for Azure CLI
# login interactive
az devops login
# login with Personal Access Token
az devops login --organization https://dev.azure.com/[ORGANIZATION]
.\backup-repos.ps1
-organization "organization"
-downloadLocation "/repos"
-personalAccessToken "[personal-access-token]"
.\backup-repos.ps1
-organization "organization"
-downloadLocation "/repos"
-personalAccessToken "[personal-access-token]"
-backupAllBranches
.\backup-repos.ps1
-organization "organization"
-downloadLocation "/repos"
-personalAccessToken "[personal-access-token]"
-backupAllBranches
-branchNameRegex "^main$|^release\/"
Personal access token is optional, otherwise it uses system configured git credentials.
docker run /
-e AZURE_DEVOPS_EXT_ORG=contoso /
-e AZURE_DEVOPS_EXT_PAT=xxxxxxxx /
-v /repos:/repos /
codingsteff/azure-devops-backup-repos
docker build --pull -t azure-devops-backup-repos .
git tag 1.0.x
git push origin --tags
Type | Source becomes => | Docker Tag |
---|---|---|
Branch | master |
latest |
Tag | /([0-9]+)?(\.[0-9]+)?(\.[0-9]+)/ |
{\1} ,{\1}{\2} ,{sourceref} |
Multiple docker tags: Regex with capture groups {\1} for major, {\2} for minor, {soureref} for full tag name