部署到Azure虚拟目录 - Web部署任务失败。(无法完成对远程代理URL的请求

时间:2015-02-03 12:09:53

标签: asp.net-mvc azure msbuild web-deployment msdeploy

我遇到了从buildserver到Azure部署asp.net mvc 4项目的问题。

我们有一个天蓝色的网站(严格来说没有直接部署到它),下面的虚拟目录中部署了许多应用程序。有了这些应用程序/虚拟目录,我遇到了部署问题。

我可以使用发布配置文件从VS内直接部署到Azure,也可以从本地使用发布配置文件的批处理文件直接部署到Azure,但听起来你不能在构建服务器上使用发布配置文件,所以我使用相同的设置用参数来激活MSBuild。

返回的错误是:

error : Web deployment task failed.(Could not complete the request to remote agent URL 'http://[site].scm.azurewebsites.net:443/MSDEPLOYAGENTSERVICE'.)

请注意,第一个错误列出了主站点,而不是虚拟目录,尽管这是通过VS工作的.pubxml文件中的值。 第一个(上面)之后列出的其他错误是..

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3847,5): error : This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server. 

error : Could not complete the request to remote agent URL 'http://[site].scm.azurewebsites.net:443/MSDEPLOYAGENTSERVICE'.
error : The underlying connection was closed: An unexpected error occurred on a receive.
error : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

..和批处理文件包括msbuild命令&参数是... ..

msbuild projectname.csproj 
/P:Configuration=DevDeployMyApp 
/p:DeployTarget=MSDeployPublish 
/p:DeployOnBuild=True 
/p:MsDeployServiceUrl=[Site].scm.azurewebsites.net:443
/p:AllowUntrustedCertificate=True 
/p:VisualStudioVersion=11.0 
/P:CreatePackageOnPublish=True 
/p:username=[user]
/p:Password=[password]
/p:DeployIisAppPath=[site]/[VirtualDirectoryName]
/p:MSDeployPublishMethod=RemoteAgent 
/p:IgnoreDeployManagedRuntimeVersion=True

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

您的服务是否已在运行,尝试进入Azure门户并在发布之前停止它。这有时会让它失灵。