使用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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...