部署 Azure 应用服务时出错:ERROR_COULD_NOT_CONNECT_TO_REMOTESVC

时间:2021-03-15 06:10:34

标签: azure azure-devops azure-webapps

我在通过 Azure DevOps 部署应用服务时遇到以下错误。我试图搜索这个问题,但找不到根本原因。

错误:

2021-03-15T06:01:27.7479723Z ##[error]Error: Error Code: ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
More Information: Could not connect to the remote computer ("web-app.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.
Error: The remote server returned an error: (403) Forbidden.
Error count: 1.
'''

3 个答案:

答案 0 :(得分:1)

根据this document,错误是由于Web Deploy无法连接到远程服务。请参考以下几点来解决您的问题:

  • 请确保 Azure 应用服务正常运行。您可以 ping 远程机器。
  • msdepsvc(“Microsoft Web 部署代理服务”)或 wmsvc(“Web 管理服务”)服务已在远程服务器上启动。
  • 您的防火墙没有阻止目的地端口的传入连接。如果您使用默认安装,则 msdepsvc 为 80,wmsvc 为 8172。

此外,您可以尝试将 -retryInterval:6000 -retryAttempts:10 添加到 Azure App Service Deploy task 中的附加参数,如 thread 所述。 enter image description here

顺便说一句,如果 Azure 管道中仍然存在此问题,请检查本地是否存在此问题。您可以参考此主题:Got 403 Error when doing Web DeploymentWeb Deploy results in ERROR_COULD_NOT_CONNECT_TO_REMOTESVC 以获取更多指导。

答案 1 :(得分:0)

感谢 Edward 对可能的根本原因进行了富有洞察力的解释。问题现已解决。 根本原因是所选的代理池没有部署权限(IP 未列入生产应用服务的白名单),因为 我们没有将 DevOps 提供的代理直接用于生产环境。 enter image description here

答案 2 :(得分:0)

一个多年来运行良好的实例,昨天在 Web 部署期间开始出现此错误。我们这边没有任何变化。没有任何非侵入性的探索解决了它,只需点击Azure 应用服务概述页面上的重新启动按钮即可轻松解决问题。