[英]Copy data using Azure Devops Pipeline to a storage account with no public network acces
I'm trying to backup a Azure DevOps repo using the following guide: https://charbelnemnom.com/how-to-backup-azure-devops-git-repositories/我正在尝试使用以下指南备份 Azure DevOps 存储库: https ://charbelnemnom.com/how-to-backup-azure-devops-git-repositories/
My YAML-File is as follows:我的 YAML 文件如下:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
branches:
include:
- '*'
stages:
- stage: _default
jobs:
- job: Job
pool:
vmImage: windows-latest
steps:
- task: CmdLine@2
inputs:
script: git clone --mirror https://PATTokenXXXX@dev.azure.com/btc-cloud/test/_git/testrepo
- task: ArchiveFiles@2
inputs:
rootFolderorFile: $(System.DefaultWorkingDirectory)/testrepo.git
includeRootFolder: true
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/Backup.zip
- task: AzureFileCopy@3
displayName: AzureBlob File Copy
inputs:
SourcePath: $(Build.ArtifactStagingDirectory)/Backup.zip
azureSubscription: test backup of devops repo
Destination: AzureBlob
storage: 'storageaccountname'
ContainerName: 'devopsbackup'
BlobPrefix: 'az-devops-repo-backup'
The Pipeline is working fine as long as the Public Network Access
is on Enabled from all networks
.只要
Enabled from all networks
Public Network Access
,管道就可以正常工作。 But when I disable public network access, the Pipeline doesn't work anymore.但是当我禁用公共网络访问时,管道不再工作。 Is there a way to implement the pipeline to use a private Network, maybe through a private endpoint?
有没有办法实现管道以使用私有网络,也许通过私有端点? But since I don't see a way how to add the DevOps pipeline to a private network, I'm kind of lost how to make the pipeline work when the storage account has public network access disabled.
但是由于我没有看到如何将 DevOps 管道添加到专用网络的方法,所以当存储帐户禁用公共网络访问时,我有点迷失如何使管道工作。 Does someone maybe know how to do it or know an alternative way to backup Azure DevOps projects?
有人可能知道该怎么做或知道备份 Azure DevOps 项目的替代方法吗?
Thanks and best regards!谢谢和最好的问候!
You need to run agent on machine that has access to your private network.您需要在可以访问您的专用网络的机器上运行代理。 Usually this can be achieved by using self-hosted agents (installed on VM, VMSS or on container instance) with access to your private network.
通常这可以通过使用可以访问您的私有网络的自托管代理(安装在 VM、VMSS 或容器实例上)来实现。
If you use Azure DevOps you may add new pool from organization settings.如果您使用 Azure DevOps,您可以从组织设置中添加新池。
Default Azure agents use public access and won't be able to access storage account with access limited only to private network.默认 Azure 代理使用公共访问权限,无法访问仅限专用网络访问的存储帐户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.