简体   繁体   English

使用 Azure Devops Pipeline 将数据复制到没有公共网络访问权限的存储帐户

[英]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 代理使用公共访问权限,无法访问仅限专用网络访问的存储帐户。

More details you may find here您可以在此处找到更多详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Azure DevOps 中的 Azure 文件复制任务将数据从存储帐户复制到存储帐户 - Using Azure File Copy Task in Azure DevOps to Copy Data from Storage Account to Storage Account Azure DevOps 管道无法复制到 Azure 存储 - Azure DevOps pipeline cannot copy to Azure storage Azure 使用 Azure devops 的存储帐户故障转移 - Azure Storage account failover using Azure devops Azure DevOps 步骤将 YAML 从 Azure 存储帐户复制到 DevOps 存储库 - Azure Devops step copy YAML from Azure storage account to DevOps repo 从公共互联网访问保护 Azure 存储 - Secure Azure Storage from public internet acces 将Blob从Azure存储帐户复制到网络路径 - Copy blob from Azure storage account to a Network Path 无法使用 Azure 数据工厂从 Azure 德国存储帐户复制数据 - Unable to copy data from Azure Germany Storage account using Azure Data Factory 如何将存储在 azure devOps 存储库中的 json 文件作为 blob 复制到 azure 存储帐户? - How to copy .json file stored in azure devOps repo to azure storage account as a blob? 使用数据工厂创建一个管道,将活动从天蓝色的Blob存储复制到数据湖存储 - create a pipeline using data factory with copy activity from azure blob storage to data lake store FMI 工具箱 Matlab Azure Devops CI Pipeline Bugs with network service account - FMI Toolbox Matlab Azure Devops CI Pipeline Bugs with network service account
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM