Skip to main content

Web Deploy experienced a connection problem (ERROR_CONNECTION_TERMINATED)

Web Deploy (msdeploy) helps system administrators to publish their applications to Azure or on-prem machines. It can also be used to migrate web applications between servers.

While trying to publish an application from Visual Studio to Azure App Service, you may come across this error 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

Unexpected end of file has occurred. The following elements are not closed: results. Line 1, position 550

ERROR_CONNECTION_TERMINATED

I have noticed that the project publishes successfully to Local IIS and Azure Functions. However, it displays the error above when we try to publish it to Azure App Service.

For more information about deploying applications in Visual Studio, check out the official documentation.

Solution for ERROR_CONNECTION_TERMINATED error

For Web Deploy to be functional, follow the steps below:

  • Management Services should be installed (Add Role and Features > Web Server)
  • Uninstall security software and try again
  • Web Management Services and Web Deploy Agent Service should be running
  • Make sure Fiddler or any other similar software is not running while publishing
  • Make sure TCP port 8172 is open in the server

After these steps, if you run into “Could not reach the Web Deploy endpoint” error, check this post out: (Solved) Could not reach the Web Deploy endpoint on the specified virtual machine

If you are looking for instructions to migrate your websites by using Web Deploy, please have a look at this post: How to migrate website between IIS servers using Web Deploy (msdeploy)

Leave a Reply

Your email address will not be published. Required fields are marked *