2
votes

I have an 'Azure File Copy' task in my Build Definition for Team Services (was Visual Studio Online). Whenever I run this I get an 'Access Denied' error. I've been trying to troubleshoot this for hours with no luck.

Copy started for machine: 'MACHINE NAME'
Copy status for machine 'MACHINE NAME' : 'Failed'
Connecting to remote server [IP ADDRESS] failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.To fix WinRM connection related issues, select the 'Enable Copy Prerequisites' option in the task. If set already, and the target Virtual Machines are backed by a Load balancer, ensure Inbound NAT rules are configured for target port (5986). Applicable only for ARM VMs. For more info please refer to http://aka.ms/azurefilecopyreadme
******************************************************************************
Finishing task: AzureFileCopy
******************************************************************************
Task AzureFileCopy failed. This caused the job to fail. Look at the logs for the task for more details.
******************************************************************************
Finishing Build
******************************************************************************

I've tried the following:

  • 'Enable Copy Prerequisites' checkbox on build task
  • Assigning the user account directly to Microsoft.Powershell with 'Full Control' permissions using PSSession -ShowSecurityDescriptorUI
  • Added Computer to the TrustedHosts List
  • Made sure the necessary ports are unblocked (inbound and outbound)

Considering that this is a Microsoft SaaS product, connecting to a standard Azure VM using nothing but Microsoft Azure architecture, I'm surprised this is so difficult. I must be missing something simple!

Thanks in advance for any advice.

1
What username and password you enter in "Azure File Copy"? The error message can be also caused by an incorrect username/password.Eddie Chen - MSFT
Just using the main admin account for the VM. I've tried with and without the PC name as a prefix. I've entered the password as plain text (not using a variable). Good point though - because I tried intentionally using incorrect credentials and received exactly the same message.tpag26
If you have any tips on how I could troubleshoot this as the possible cause, would be most appreciated! Thank youtpag26

1 Answers

0
votes

I made the mistake of using builtin\administrator as the username but after a couple of hours debugging the same error you're getting I found out that is a UPN and not allowed. I changed it to .\administrator and that worked!

Also check out this site for troubleshooting, it really goes into details with some of the things: http://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure