3

I have multiple Azure VMs (Classic) running and want to copy a setup.exe as result of a TFS build process to these VMs. Since the setup is about 800MB in size I don't want to copy it x times for every VM. What is the best practice to copy it only once and then distribute it to all VMs?

Jason H
  • 4,996
  • 6
  • 27
  • 49
Konrad
  • 4,329
  • 10
  • 54
  • 88

2 Answers2

2

Since you are using Azure VMs you can setup File Storage and then have the VMs map a drive to the file storage. This way you can upload the file to one location but all your VMs will have access to it.
https://learn.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-files

Jason H
  • 4,996
  • 6
  • 27
  • 49
2

Usually we are using Azure File Copy task which use the AzCopy to handle the copy situation.

When the target is Azure VMs, the files are first copied to an automatically generated Azure blob container and then downloaded into the VMs. The container is deleted after the files have been successfully copied to the VMs.

Even though it's not copy the same file from build agent to the VMs multiple times. And the download is inside the azure could. 800MB is still a large file size. It will take a long time.

File Storage is a good solution, however you need to manually map the drive with the file storage for all the VMs first. And AzCopy is not support on file storage. You need to use a powershell script in TFS release definition to handle this.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62