【发布时间】:2015-02-03 12:09:53
【问题描述】:
我在将 asp.net mvc 4 项目从 buildserver 部署到 Azure 时遇到问题。
我们有一个天蓝色的网站(严格来说没有直接部署任何东西),在下面的虚拟目录中部署了许多应用程序。我在部署到这些应用程序/虚拟目录时遇到问题。
我可以使用发布配置文件从 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
有什么想法吗?
【问题讨论】:
-
我不确定使用虚拟目录是否是将单独的 Web 应用程序部署到 Azure 的最佳选择。如果您想继续使用此设置,那么您可能还需要考虑使用通过 ftp 部署。可以通过 ftp 访问您的网站,并且可以使用 Azure 门户管理其凭据。
-
它一直像我的开发 PC 的魅力一样工作,但是当尝试通过构建服务器进行部署时,聚会停止了。我现在想看看如何通过 FTP 进行部署。最终我只想能够通过构建自动部署 - 我不在乎如何:) 谢谢。
标签: asp.net-mvc azure msbuild web-deployment msdeploy