1
votes

I am using TFS (2015 update 3 and implemented CI build. I created two environments for release, one is staging and other is production hosted in AWS windows VM. I am using IIS Deploy WinRM extension(https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.iiswebapp) in release task to deploy the package to the remote server.

staging IIS is hosted in same build machine and deployment task is working fine. when I deploy to production environment I am getting following error.

Deployment failed on machine xx.xx.xx.xx with following message: System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server xx.xx.xx.xx failed with the following error message: WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits accesses to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.

I believe WinRM is not able to communicate with target server hence it is not working. I tried to follow instructions in this link (https://docs.microsoft.com/en-us/vsts/build-release/apps/cd/deploy-webdeploy-iis-winrm).

I configured winRM in both machines and even added build machine (where I initiate release) to trusted hosts on the target server. In both machines, winRM service is listening to ports 5985,5986.

i tried to test WinRM connection and tried following command in build machine. test-wsman -ComputerName -UseSSL

I got following error

test-wsman : ">WinRM cannot complete the operation. Verify that the specified computer name is valid, that the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet.

I am sure the issue is WinRM not able to communicate with the target server. One of the requirements of this TFS winRM deployment extension is both servers should be domain joined or workgroup joined. (mentioned in https://docs.microsoft.com/en-us/vsts/build-release/apps/cd/deploy-webdeploy-iis-winrm) . Is this why deployment not working and how can I join both domains? As target server is hosted in AWS ( it is a windows VM machine), we connect through VPN. Build machine's name is like MachineName.uk.companyname.com and target servers name is MachineName.abc.risk.cloud (both in different domains)

Any thoughts on debugging this and get this deployment working in target server?

1

1 Answers

0
votes

WinRM configuration

Windows Remote Management (WinRM) requires target servers to be:

  • Domain-joined or workgroup-joined
  • Able to communicate using the HTTP or HTTPS protocol
  • Addressed by using a fully-qualified domain name (FQDN) or an IP address

Just as the document described, you need to follow the requirements of WinRm configuration. Since using test-wsman -ComputerName -UseSSL also shows communicate with the target server, this is why deployment not working.

For AWS related, you could try to use AWS Tools for Microsoft Visual Studio Team Services. The AWS Tools for Microsoft Visual Studio Team Services (VSTS) is an extension for Microsoft VSTS and on-premises Microsoft Team Foundation Server (TFS) that makes it easy to deploy .NET applications to AWS.