'Error while Deploy Azure App Service : ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
I am getting below error while deploying app service via Azure DevOps. I tried to search for this issue but could not found root cause of this.
Error :
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.
'''
Solution 1:[1]
Thank you Edward for insightful explanation for possible root cause. Issue is resolved now. Root cause was the agent pool selected did not have rights for deployment(IP are not whitelisted for production App service) since We are not using agent provided by DevOps directly for production environment.
Solution 2:[2]
I tried everything until I spotted (after reading this) that my (dev) shared App Service service plan was out of storage space! When I upgraded it to a bigger one I could deploy again!
Solution 3:[3]
According to this document, the error is caused by that Web Deploy cannot connect to the remote service. Please refer to the follow points to troubleshoot your problem:
- Please make sure Azure app service works fine. You can ping the remote machine.
- That the msdepsvc(“Microsoft Web Deployment Agent Service”) or wmsvc(“Web Management Service”) service is started on the remote server.
- Your firewall is not blocking incoming connections of your ports on the destination. If you used the default installation, then it would be 80 for msdepsvc and 8172 for wmsvc.
In addition, you could try to add -retryInterval:6000 -retryAttempts:10
to Additional Arguments in Azure App Service Deploy task as this thread stated.
BTW, if this issue still exists in Azure pipeline, please check if this issue exists locally. You could refer to this thread: Got 403 Error when doing Web Deployment and Web Deploy results in ERROR_COULD_NOT_CONNECT_TO_REMOTESVC for more guidance.
Solution 4:[4]
An instance that'd worked great for years starting giving me this error yesterday during Web Deploy. No changes from our side. No amount of poking around non-invasively solved it, but simply hitting the Restart button on the Azure app service Overview page put it to bed quite easily.
Solution 5:[5]
In short: Double-check your publish profile (each element).
Bit longer: In my case, my publish profile contained a ResourceGroup
element which pointed to the wrong resource group. (I'm using WebPublishMethod
: MSDeploy
) I went over all elements and made sure they point to the correct resource, credentials and whatnot.
That seemed to solve the issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | ctor |
Solution 2 | Sturla |
Solution 3 | Edward Han-MSFT |
Solution 4 | Eliot Gillum |
Solution 5 | Stefan Hendriks |