-2

I am setting up my build pipeline in VSTS and need to download some .zip files from an on-premise server. Currently, I am looking into using the "Powershell Script" step, but I do not know how to configure this step, such that it can reach files hosted on-premise.

a) Is it possible to download files from an on-premise server using the "PowerShell Script step in VSTS?"

b) If no, what are my alternatives? I am thinking of hosting the .zip files in an Azure Blob storage as an alternative, but that requires setting up some SAS tokens etc.

Hos
  • 583
  • 1
  • 6
  • 25
  • I can only assume you have not even bothered to research this yourself, as you would have found [Copy-Item](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/copy-item?view=powershell-5.1) and [Invoke-WebRequest](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1) – henrycarteruk Jan 09 '18 at 16:51
  • 1
    I can only assume you have not even bothered reading my question, as you would have found that I want to download files from an on-premise server, which by default is not reachable from VSTS. Yes, I did research this myself. Yes, I did Google for powershell cmdlets. Yes, I did Google for VSTS guides. – Hos Jan 09 '18 at 18:22

1 Answers1

2

Yes, you can.

The simple way is that you can setup a private build agent and copy files through Copy Files or Windows Machine File Copy task, for this way, your on-premise server just need to be accessible from your private build agent machine.

Deploy an agent on Windows

If you need to use Hosted agent, then your on-premise server need to be accessible from internet, you can build a public API app or FTP server for downloading files.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53