i am new to devops, i have created a release pipeline containing task 'Powershell on target machine'. This task fails with below error :
Unable to create pssession. Error: '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 access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.'
Tried :
I have enabled WinRM using the WinRM quickconfig / Enable-PSRemoting -force.
updated the Remote Management firewall to support any public inbound, default was 'local subnet'.
I have also updated the trusted source to all inbound request *.
added port in nsg.
Still gets the same error. am i missing anything to setup in target VM?