![](/img/trans.png)
[英]How to copy a file from Azure Storage to a VM in agent pool in a pipeline?
[英]How to copy files from Azure File Storage to Azure VM in release pipeline TFS?
Is there any built-in TFS build task or PowerShell script to copy files from Azure File Storage to Azure VM via release deployment pipeline in TFS. 我试着在网上找了一下,但没有得到任何成果。
不,我们没有这种内置任务。 我们有一个Azure 文件复制任务,它使用它将应用程序文件和其他工件复制到 Microsoft Azure 存储 blob 或虚拟机 (VM)。
当目标是 Azure VM 时,首先将文件复制到自动生成的 Azure blob 容器,然后下载到 VM。 将文件成功复制到 VM 后,将删除容器。
您可以在 VM 上使用AzCopy 命令将数据从 blob 复制/下载到本地驱动程序。
.\AzCopy /Source:C:\myfolder /Dest:https://myaccount.blob.core.windows.net/mycontainer/myfolder/ /DestKey:key /Pattern:abc.txt
登录远程虚拟机
.\AzCopy /Source:https://myaccount.file.core.windows.net/myfileshare/myfolder/ /Dest:C:\myfolder /SourceKey:key /Pattern:abc.txt
对于 PowerShell,您需要在所有平台上使用 PowerShell Core 6.x 及更高版本。 It works with Windows and Linux virtual machines using Windows PowerShell 5.1 (Windows only) or PowerShell 6 (Windows and Linux).
您可以在本文档中找到 PowerShell 命令: 快速入门:使用 Azure PowerShell 上传、下载和列出 Blob
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.