Error while Deploy Azure App Service : ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
Asked Answered
I

7

6

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.
'''
Intervention answered 15/3, 2021 at 6:10 Comment(0)
I
0

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. enter image description here

Intervention answered 16/3, 2021 at 9:5 Comment(0)
C
16

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!

enter image description here

Cereus answered 21/10, 2021 at 10:42 Comment(2)
lack of storage space it was...Pragmatism
Looked at the above screen in the DevOps UI which showed we were at our threshold - removed some logs in LogFiles/stdout and all okSquishy
U
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. enter image description here

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.

Unhook answered 16/3, 2021 at 2:7 Comment(2)
Thank you, in my case it was a firewall/networking issue. I had Access Restrictions switched on on my App Service, with Allow Public Access unticked.Worktable
Seems that instance running at 100 % CPU can also block it. We had one instance in unhealthy state due to one app misbehaving and seems that was the cause for us. App service plan CPU metrics split by instance revealed this as I paid attention to kudu on responding in the process view and that there are two instances.Whitford
T
1

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.

Thereabout answered 24/6, 2021 at 20:8 Comment(1)
That seemd to fix it for me too, very odd.Arty
I
0

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. enter image description here

Intervention answered 16/3, 2021 at 9:5 Comment(0)
G
0

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.

Gothart answered 9/5, 2022 at 7:15 Comment(0)
S
0

In my case, I had modified machine.config to captur traffic in Fiddler

<system.net>
<defaultProxy
                enabled = "true"
                useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>

and this was interfering with the VS deployment to Azure

Stoa answered 17/1, 2023 at 19:46 Comment(0)
R
0

In my case, the build server was using outdated username and password from the publish profile inside project properties. Once we updated that it started working fine. The error is so wrong which made us believe that server is unavailable somehow.

Ratfink answered 13/8, 2024 at 12:52 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.