WinRM访问被拒绝(Visual Studio Team Services的构建定义中的Azure文件复制任务)

时间:2016-04-27 10:13:52

标签: powershell azure azure-devops azure-pipelines-build-task

我在团队服务的构建定义中有一个'Azure文件复制'任务(是Visual Studio Online)。每当我运行这个时,我都会收到“拒绝访问”错误。我一直试图解决这个问题几个小时没有运气。

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
******************************************************************************

我尝试了以下内容:

  • 在构建任务
  • 上启用“复制先决条件”复选框
  • 使用PSSession -ShowSecurityDescriptorUI
  • 将用户帐户直接分配给具有“完全控制”权限的Microsoft.Powershell
  • 将计算机添加到TrustedHosts列表
  • 确保必要的端口已取消阻止(入站和出站)

考虑到这是一个Microsoft SaaS产品,只使用Microsoft Azure架构连接到标准Azure VM,我很惊讶这很难。我一定错过了简单的事情!

提前感谢任何建议。

1 个答案:

答案 0 :(得分:0)

我犯了使用builtin \ administrator作为用户名的错误,但经过几个小时调试同一个错误后我发现这是一个UPN而且不被允许。我将其更改为。\ administrator,这有效!

另请查看此网站以进行问题排查,其中包含以下内容:http://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure