How feasible is option b?
It's possible in Azure Devops Service. What you need is a Yaml pipeline which triggers all branches.
You can use command line task to backup the repo into {RepoName}.git
folder, and then copy this folder into Azure Storage using Azure File Copy task. Similar to this:
trigger:
branches:
include:
- '*'
pool:
vmImage: 'windows-latest'
steps:
- task: CmdLine@2
inputs:
script: 'git clone --mirror https://{Your PAT}@dev.azure.com/{OrgName}/{ProjectName}/_git/{RepoName}'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/{RepoName}.git'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Backup.zip'
replaceExistingArchive: true
- task: AzureFileCopy@4
displayName: 'AzureBlob File Copy'
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/Backup.zip'
azureSubscription: xxxx
Destination: AzureBlob
storage: xxxxxxxx
ContainerName: arm
BlobPrefix: test
Details:
1.CI Trigger with wildcard(*) can monitor all your branches. So if there's any update with your repo, the pipeline will be triggered to run.
2.The cmd task calls git clone --mirror to make the copy of your git repo. To copy Azure Git repo in cmd task with PAT, you can follow the format here:
git clone https://{yourPAT}@dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName
This command will create a RepoName.git
folder which contains the copy of your repo in this path: $(System.DefaultWorkingDirectory)
. To create PAT, you only need to create one with Code-read access scope:

3.The logic is: If there's any change to your source repo=>The pipeline will be triggered=>It make a latest copy in DefaultWorkingDirectory(CMD task)=>Archive this copy into a Backup.zip
file(Archive file task=>Azure File copy task will copy this Backup.zip
to Azure storage blobs)