首页 文章

SQL项目通过Visual Studio Team Services部署到VM上的SQL Server

提问于
浏览
0

我正在尝试通过Visual Studio Team Services持续集成脚本在VM上设置部署到SQL Server的SQL Server DACPAC项目 . 这是我的构建定义
enter image description here

enter image description here
对于服务器名称,我输入了VM的公共IP,对于管理员登录,我在该VM上输入了管理员帐户用户名,

然后我在构建中遇到以下错误

[error] Microsoft.PowerShell.Commands.WriteErrorException:一台或多台计算机上的部署失败 . System.Management.Automation.Remoting.PSRemotingTransportException:连接到远程服务器xx.xxx.xx.xx失败,并显示以下错误消息:WinRM无法完成操作 . 验证指定的计算机名称是否有效,计算机是否可通过网络访问,以及是否启用了WinRM服务的防火墙例外,并允许从此计算机进行访问 . 默认情况下,公共配置文件的WinRM防火墙例外限制对同一本地子网内的远程计算机的访问 . 有关详细信息,请参阅about_Remote_Troubleshooting帮助主题 .

然后我在SQL VM上尝试了以下powershell命令

Enable-PSRemoting -Force
winrm quickconfig -transport:http

第二个命令挂断,显示以下消息

配置LocalAccountTokenFilterPolicy以远程授予本地用户管理权限 .

然后我尝试了以下
enter image description here

入境口岸
enter image description here

netstat -ant | findstr 5985
enter image description here

1 回答

  • 1

    首先,您应该确保winrm服务正在倾听 .

    netstat -ant|findstr 5985
    

    默认情况下,端口正在侦听5985.如果服务没有侦听,请执行

    winrm quickconfig
    

    其次,您应该在VM Windows防火墙和Azure NSG(入站规则)上打开端口 .

    enter image description here

    对于测试,您应确保可以在本地PC上winrm您的SQL VM .

相关问题