如何解决使用WinRM从Azure Pipelines连接到Azure VM
从Azure管道中,我正在使用ARM模板启动Azure VM。然后,我需要在该VM上打开端口。为此,我尝试使用WinRM。我正在关注这篇文章:https://docs.microsoft.com/en-us/azure/virtual-machines/windows/winrm,并且像本文所述的那样设置了密钥库和ARM模板。
虚拟机位于具有始终配置的vnet的资源组中。 VM的vnet和构建服务器的vnet彼此对等。
在管道中,我正在使用AzurePowershell@4
任务执行New-AzResourceGroupDeployment
cmdlet来置备VM。虚拟机已成功配置。
然后运行一个Enter-PSSession
命令,然后出现以下错误:
Enter-PSSession : Connecting to remote server x.x.x.x 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.
如果我远程访问构建服务器并从Powershell运行Enter-PSSession
命令,它就可以正常工作。我如何才能通过Azure管道获得此功能?还是有更好的方法在VM上打开端口?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。