![](/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.