简体   繁体   English

使用 Azure DevOps 中的 Azure 文件复制任务将数据从存储帐户复制到存储帐户

[英]Using Azure File Copy Task in Azure DevOps to Copy Data from Storage Account to Storage Account

I have the following YAML configured but guessing I cannot use a storage account for a source input here?我配置了以下 YAML 但猜测我不能在这里使用存储帐户作为源输入? I assumed I could since the task simply uses azcopy (note: the command works fine from command line just not in the pipeline (ie permissions are set (eg SPN has been authorized and RBAC set).我假设我可以,因为该任务只是使用 azcopy (注意:该命令在命令行中运行良好,只是不在管道中(即设置了权限(例如,已授权 SPN 并设置了 RBAC)。

Here's the code:这是代码:

trigger:
- dev

pool:
  vmImage: windows-latest
steps:
 #Copy files to Azure Blob Storage
- task: AzureFileCopy@4
  inputs:
    sourcePath: 'https://someonesbackups.blob.core.windows.net/backups?mysastokengoeshere'
    azureSubscription: MY-Production-Subscription
    destination: azureBlob
    storage: azcopypipelinetest
    containerName: restored
    additionalArgumentsForBlobCopy: --recursive=true

However, when that runs I get the following error:但是,当它运行时,我收到以下错误:

"failed to perform copy command due to error: cannot start job due to error: cannot scan the path \\?\D:\a\1\s\https:\someonesbackups.blob.core.windows.net\backups?mysastokengoeshere=-REDACTED-, please verify that it is a valid."

Certainly seems as though you could do this but guessing I'm missing something fundamental here.当然看起来好像你可以做到这一点,但我猜我在这里遗漏了一些基本的东西。

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-file-copy?view=azure-devops https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-file-copy?view=azure-devops

Azure File Copy task only supports to upload the files from local machine or UNC share to storage account. Azure 文件复制任务仅支持将文件从本地计算机或 UNC 共享上传到存储帐户。

You could check the sourcepath field definition in task introuduction.您可以在任务介绍中检查sourcepath 字段定义。

在此处输入图像描述

To Copy Data from Storage Account to Storage Account, you need to use azcopy command to copy to the file to local machine and use Azure File Copy task to upload the file to another storage account.要将数据从存储帐户复制到存储帐户,您需要使用azcopy 命令将文件复制到本地计算机,并使用 Azure 文件复制任务将文件上传到另一个存储帐户。

- script: 'azcopy copy ''https://mystorageaccount.blob.core.windows.net/mycontainer/myBlobDirectory/*'' ''$(build.sourcesdirectory)\myDirectory'''
  displayName: 'Command Line Script'

- task: AzureFileCopy@4
  inputs:
    sourcePath: '$(build.sourcesdirectory)\myDirectory'
    azureSubscription: MY-Production-Subscription
    destination: azureBlob
    storage: azcopypipelinetest
    containerName: restored
    additionalArgumentsForBlobCopy: --recursive=true

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

相关问题 使用 Azure Devops Pipeline 将数据复制到没有公共网络访问权限的存储帐户 - Copy data using Azure Devops Pipeline to a storage account with no public network acces Azure - 将文件从 VM 复制到存储帐户 - Azure - copy files from VM to a storage account Azure DevOps 步骤将 YAML 从 Azure 存储帐户复制到 DevOps 存储库 - Azure Devops step copy YAML from Azure storage account to DevOps repo Azure Powershell将Azure存储帐户复制到另一个Azure存储帐户 - Azure Powershell to copy azure storage account to another azure storage account Powershell:将文件从 Azure 文件共享复制到 Blob 存储帐户 - Powershell: Copy file from Azure File Share to Blob Storage account 将文件从一个Azure存储帐户复制到另一个 - Copy file from one Azure storage account to another 无法使用 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? Azure 使用 Azure devops 的存储帐户故障转移 - Azure Storage account failover using Azure devops 将 Parquet 文件从 Azure 数据湖存储帐户复制到 Synapse 数据仓库表失败 - Copy parquet file from Azure data lake storage account to Synapse data warehouse table failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM