Windows Machine File Copy - DevOps task and IP address Windows Machine File Copy - DevOps task and IP address powershell powershell

Windows Machine File Copy - DevOps task and IP address


I was getting the exact same error while doing these:

  • Initially in my release pipeline, I had an agent job and I created a Windows machine file copy task under the job and filled in all details correctly. I set the Machines field with the public IP address of my target server (a Windows azure VM) and I always got this error you reported.

  • I tried to use the Azure file copy task instead but I was faced with another problem (error message: Unable to get FQDN for all resources in ResourceGroup: {resourceGroupName}) which I couldn't get to fix after a lot of efforts.

This is the solution that worked for me:

  • Instead of running an agent job, I ran a Deployment Group Job. With deployment groups, I didn't need an IP address to connect to my VM. Setting up a deployment group for your Azure VM is very simple and well explained here

  • I created a Windows Machine File Copy task under the Deployment Group job I added. I filled same details for the task except that instead of the IP address of the Windows VM, I entered the computer name in the Machines field and the file copy task ran successfully!

I hope this helps


The problem is because you can't use that task to copy files across Windows Domain boundary! That is to say, if you build on host A and want to copy files to host B, then A and B must be in the same Windows Domain, otherwise you'll get the error like

##[error]Failed to Create PSDrive with Destination: '\\your-server-name-or-ip\some\path', ErrorMessage: 'The network path was not found'

That is to say, if you're using a hosted agent, then you're not able to copy files with that task to any host you have, no matter it has a public IP or not, or a FQDN, because they are not in the same Windows Domain!

You have two options to work around it:

  • Use Azure File Copy task if your target is an Azure VM or Azure Storage
  • Use private hosted agent and make sure your target host and your private agent are in the same Windows Domain

Last but not least, the document should really make it clear! It wasted me a lot of time on solving the problem!


go to the destination folder, right-click the folder select properties,share option is there, click that one and share everyone option is there