MSDeploy天青Web应用程序:无法使用指定的过程连接到远程计算机(; Web管理服务"&QUOT) [英] MSDeploy to Azure Web App: Could not connect to the remote computer using the specified process ("Web Management Service")

查看:701
本文介绍了MSDeploy天青Web应用程序:无法使用指定的过程连接到远程计算机(; Web管理服务"&QUOT)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们用下面的脚本使用的MSBuild MSDeploy在VSO / VSTS建设(vNext)发布到我们的Azure的Web应用程序。这个效果很好。

但分配时,自定义域Azure的Web应用程序(通过在Azure门户网站),发布失败。

VSTS生成错误的MSDeploy:


  

出版与出版法[MSDeploy]
  执行命令[C:\\ Program Files文件\\ IIS \\微软Web部署V3 \\ msdeploy.exe-source:IisApp =C:\\ A \\ 8b0700fff \\ MrProjectMain \\阿比\\ wwwroot的'-dest:IisApp ='MyProject的-的精良Web应用程序,计算机名='的https://myproject-prod-webapp.azurewebsites.net/msdeploy.axd',UserName='$myproject-prod-webapp',Password='{PASSWORD-REMOVED-FROM-LOG}',IncludeAcls='False',AuthType='Basic' -verb:同步-enableLink:contentLibExtension -retryAttempts:2 -disablerule:BackupRule]结果
  [错误]错误code:ERROR_COULD_NOT_CONNECT_TO_REMOTESVC结果
  [错误]更多信息:使用指定的进程(Web管理服务),因为服务器没有响应无法连接到远程计算机(myproject-prod-webapp.azurewebsites.net)。确保进程(Web管理服务)开始在远程计算机上。了解更多:的http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.
  [错误]错误:远程服务器返回错误:禁止(403)结果
  [错误]错误计数:1。


的Azure门户自定义域设置:

天青门户自定义域

发布脚本:

 参数($ websiteName,$ packOutput)$网站= GET-AzureWebsite -Name $ websiteName
$ msdeployurl = $ website.EnabledHostNames [1]$ publishProperties = @ {'WebPublishMethod'='MSDeploy';
                        MSDeployServiceUrl'= $ msdeployurl;
                        DeployIisAppPath'= $ website.Name;
                        用户名= $ website.PublishingUsername;
                        密码= $ website.PublishingPassword;
                        SkipExtraFilesOnServer'='假';
                        AllowUntrustedCertificate'='真'}写输出发布的Web应用程序。
$ publishScript =$ {ENV:PROGRAMFILES(X86)} \\微软的Visual Studio 14.0 \\ Common7 \\ IDE \\扩展\\微软\\网络工具\\发布\\脚本\\默认publish.ps1
。 $ publishScript -publishProperties $ publishProperties -packOutput $ packOutput


解决方案

这个问题是在这里:

  $ msdeployurl = $ website.EnabledHostNames [1]

默认情况下,MSDeploy SCM URL是EnabledHostNames数组中的第二位。因此,它的工作原理是默认。但是当你做了一些更改您的Web应用程序,可能不尽快工作。根据你提供的日志,MSDeploy正在尝试连接到 https://开头的myproject-PROD -webapp.azurewebsites.net/msdeploy.axd ,这是不是一个SCM URL。单片机URL应该是这样的:的https://myproject-prod-webapp.scm .azurewebsites.net / msdeploy.axd 。所以你需要检查什么是正确的SCM URL序列号了。您可以添加code像在PowerShell脚本下面,看看哪一个是SCM的URL,然后相应地更新脚本。

 写输出$ website.EnabledHostNames [0]
写输出$ website.EnabledHostNames [1]
写输出$ website.EnabledHostNames [2]
...

您也可以参考<一个href=\"http://www.brandonmartinez.com/2015/09/09/resolve-an-asp-net-5-deployment-issue-to-azure-web-app-slot/\"相对=nofollow>这篇文章更新你的脚本来自动获取正确的SCM网址。

We publish to our Azure Web App using MSBuild MSDeploy in VSO/VSTS Build (vNext) using the script below. This works well.

BUT, when assigning the Azure Web App to a custom domain (through the Azure Portal), the publish fails.

VSTS Build error on MSDeploy:

Publishing with publish method [MSDeploy] Executing command ["C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:IisApp='C:\a\8b0700fff\MrProjectMain\Api\wwwroot' -dest:IisApp='myproject-prod-webapp',ComputerName='https://myproject-prod-webapp.azurewebsites.net/msdeploy.axd',UserName='$myproject-prod-webapp',Password='{PASSWORD-REMOVED-FROM-LOG}',IncludeAcls='False',AuthType='Basic' -verb:sync -enableLink:contentLibExtension -retryAttempts:2 -disablerule:BackupRule]
[error]Error Code: ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
[error]More Information: Could not connect to the remote computer ("myproject-prod-webapp.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC. [error]Error: The remote server returned an error: (403) Forbidden.
[error]Error count: 1.

Azure portal custom domain setup:

Publish script:

param($websiteName, $packOutput)

$website = Get-AzureWebsite -Name $websiteName
$msdeployurl = $website.EnabledHostNames[1]

$publishProperties = @{'WebPublishMethod'='MSDeploy';
                        'MSDeployServiceUrl'=$msdeployurl;
                        'DeployIisAppPath'=$website.Name;
                        'Username'=$website.PublishingUsername;
                        'Password'=$website.PublishingPassword;
                        'SkipExtraFilesOnServer'='False';
                        'AllowUntrustedCertificate'='True'}

Write-Output "Publishing web app..."
$publishScript = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\default-publish.ps1"
. $publishScript -publishProperties $publishProperties  -packOutput $packOutput

解决方案

The issue is here:

$msdeployurl = $website.EnabledHostNames[1]

By default, the MSDeploy SCM URL is the second in the EnabledHostNames array. So it works by default. But it may not work as soon as you made some changes to your web app. According to the logs you provided, MSDeploy is trying to connect to "https://myproject-prod-webapp.azurewebsites.net/msdeploy.axd", this is not a SCM URL. The SCM URL should like this: "https://myproject-prod-webapp.scm.azurewebsites.net/msdeploy.axd". So you need to check what is the correct scm URL array number now. You can add the code like following in the PowerShell script to see which one is the scm URL and then update the script accordingly.

Write-Output $website.EnabledHostNames[0]
Write-Output $website.EnabledHostNames[1]
Write-Output $website.EnabledHostNames[2]
...

You can also refer to this article to update your script to get the correct SCM url automatically.

这篇关于MSDeploy天青Web应用程序:无法使用指定的过程连接到远程计算机(; Web管理服务&QUOT;&QUOT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆