【问题标题】:Web Deploy to Azure Stopped Working even with downloaded publish profile即使下载了发布配置文件,Web 部署到 Azure 也停止工作
【发布时间】:2020-03-13 11:17:14
【问题描述】:

我的从 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 重新下载发布配置文件

这些都不起作用。

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

最终奏效的是

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

我查看了它,但不确定它做了什么,为什么我需要这样做,以及为什么在没有此设置之前它可以正常工作。感觉就像一个黑客修复,我不喜欢它。我应该保留此应用程序设置吗?

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

【问题讨论】:

  • 如果问题出在 Azure 端,您是否尝试重新创建应用服务?
  • @CarlosGarcia 重新创建应用服务是什么意思?
  • 出现这个问题的原因很多,请确保您的部署工具没有问题。

标签: azure webdeploy


【解决方案1】:

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

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

(添加未选中的选项。)

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

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-24
    • 1970-01-01
    • 1970-01-01
    • 2021-10-28
    • 2022-11-29
    • 1970-01-01
    • 2013-06-27
    • 1970-01-01
    相关资源
    最近更新 更多