azure - 即使下载了发布配置文件,Web 部署到 Azure 也停止工作

标签 azure webdeploy

昨天从 Visual Studio 2017 到我的 Azure Web 应用程序的 Web 部署发布非常挑剔,今天完全停止工作。

昨天事件查看器中的错误是

Error Code:  6  Exception Message:  Could not connect to the remote computer ("MYDOMAIN.scm.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.  Exception Stack Trace: The remote server returned an error: (403) Forbidden.
   at System.Net.HttpWebRequest.GetResponse()
   at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponseHelper(HttpWebRequest request)
   --- End of inner exception stack trace ---   
Could not connect to the remote computer ("MYDOMAIN.scm.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.
   at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponseHelper(HttpWebRequest request)
   at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
   at Microsoft.Web.Deployment.AgentClientProvider.PerformHeadRequestHelper(Boolean getVersionInfo, Version& maximumSupportedVersion, Version& minimumSupportedVersion)
   at Microsoft.Web.Deployment.AgentClientProvider..ctor(DeploymentProviderContext providerContext, DeploymentBaseContext baseContext, String serverVersion)
   at Microsoft.Web.Deployment.DeploymentManager.CreateObjectPrivate(DeploymentProviderContext providerContext, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
   at Microsoft.Web.Deployment.DeploymentManager.CreateDestinationObject(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentObject sourceObject, String serverVersion)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions) 

今天的错误是:

Error Code:  103  Exception Message:  Web Deploy experienced a connection problem with the server and had to terminate the connection.  Contact your server administrator if the problem persists.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.  Exception Stack Trace: Root element is missing.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Web.Deployment.TraceEventSerializer.Deserialize(Stream responseStream, DeploymentBaseContext baseContext, DeploymentSyncContext syncContext)
   --- End of inner exception stack trace ---   
Web Deploy experienced a connection problem with the server and had to terminate the connection.  Contact your server administrator if the problem persists.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.
   at Microsoft.Web.Deployment.TraceEventSerializer.Deserialize(Stream responseStream, DeploymentBaseContext baseContext, DeploymentSyncContext syncContext)
   at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext, Nullable`1 syncPass, String syncSessionId)
   at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId)
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions) 

在查看了有关此事的许多不确定的帖子后(并且由于此错误 ERROR_CONNECTION_TERMINATED 未在他们在错误中提供的官方故障排除网站上列出),我执行了以下操作: (1) 重新启动计算机 (2)重启Visual Studio (3)以管理员身份打开Visual Studio (4)从Azure重新下载Publish配置文件

这些都不起作用。

在发布配置文件窗口中,当我单击“验证”我的凭据时,它们会通过。仅当我预览或运行发布时才会出错。

最终起作用的是

(5) 在 Azure WEBSITE_WEBDEPLOY_USE_SCM 中将应用程序设置设置为 false

我查了一下它,不确定它做了什么,为什么我需要这样做,以及为什么在没有这个设置的情况下它之前工作得很好。这感觉就像是黑客修复,我不喜欢它。我应该保留此应用程序设置吗?

更新: 不确定 SCM 设置是否有帮助。我能够发布一次,之后就不能再发布了。

最佳答案

首先,关闭防火墙和本地基于代理的软件。

其次,确保您已安装 Web 部署处理程序并且已安装所有选项。

enter image description here

(添加未选中的选项。)

第三,确保管理服务没有 IP 限制。

您可以在此官方文档中找到其他可能的原因:

https://learn.microsoft.com/en-us/iis/publish/troubleshooting-web-deploy/troubleshooting-web-deploy-problems-with-visual-studio

关于azure - 即使下载了发布配置文件,Web 部署到 Azure 也停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60663294/

相关文章:

powershell - 如何删除azure sql db的长期保留并删除保管库

c# - Entity Framework 查询性能慢

azure - 在 Azure 中运行时 LocalResources 保存在哪里?

.net - 用 MSDeploy 替换整个配置文件

azure - ADF数据流: invalid column name

azure - 如何在 Azure Function 中使路由参数可选

deployment - 在 Azure Devops 中手动调用 MsDeploy.exe

visual-studio-2015 - 如何恢复与发布配置文件关联的密码?

visual-studio-2010 - MsDeploySourceManifest - RunCommand : Set options (DontUseCommandExe, waitInterval)

svn - 使用 teamcity 在 svn 中自动分支