Microsoft.TeamFoundation.Release.Common.Helpers.OperationFailedException: Failed to establish remote power shell session

Recently one of the customers reported that his releases with the release management service on visual studio online are failing with following error.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> Microsoft.TeamFoundation.Release.Common.Helpers.OperationFailedException: Failed to establish remote power shell session to the deployment machine mymachine.cloudapp.net on the port:58091 due to unexpected exception. Error Message:
System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server mymachine.cloudapp.net failed with the following error message : The server certificate on the destination computer (mymachine.cloudapp.net:58091) has the following errors:
The SSL certificate is signed by an unknown certificate authority. For more information, see the about_Remote_Troubleshooting Help topic.
at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOpen(IAsyncResult asyncResult)
at System.Management.Automation.RemoteRunspace.Open()
at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.GetOpenedRunspace()
at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.EstablishRemoteSession()

This error occurs when the SSL certificate on the remote machine is not trusted by the service and in the release definition, the switch to ignore this error is not enabled. To come out of this, you should turn on that switch. Here are the steps that you should follow.

  • In “Deploy using PS/DSC” action of the release definition, you’ll find parameter named “SkipCaCheck”. Please set the value as true as shown below.

clip_image001

  • Do it for all the Deploy using PS/DSC action and save it. Now your releases should work.

Enjoy !!