Azure webapp deployments failed since upgrade

I’ve been emailing support on this for the past couple of days. Hopefully someone else might have this problem or know of a fix.

Since upgrading to 3.11.12 Monday morning, all of our Azure web app deployments are broken. This was with apps that previously deployed fine.

At first we thought it was web.config transform related but that turned out be a red herring (removing the config transform step completely). The error seems to be in web deploy and fails connecting:

08:02:13 Verbose | Pre-authenticating to remote agent URL ‘https:///msdeploy.axd?site=’ as ‘$****’.
08:02:13 Verbose | The HTTP connection (ID=‘12fb8035-92b4-45d6-946e-ec89f582ba08’, type =‘GetTraceStatus’) is being kept alive while the request is processed.
08:02:13 Verbose | The HTTP connection (ID=‘12fb8035-92b4-45d6-946e-ec89f582ba08’, type =‘GetTraceStatus’) is being kept alive while the request is processed.
08:02:13 Verbose | The HTTP connection (ID=‘12fb8035-92b4-45d6-946e-ec89f582ba08’, type =‘GetTraceStatus’) is being kept alive while the request is processed.
08:02:14 Verbose | Retry #1 on Azure deploy. Exception: 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.

(the **** are the actual values we use but not shared here)

I can’t find anyone with this problem right now but it’s happening on all our Azure deploys (different subscriptions, different certs, etc.). I’ve remade the cert with one of the failing uploads and it still fails with the same error.

There was another issue like this from last year but it was moved to email support and the thread was closed with no root cause:
http://help.octopusdeploy.com/discussions/problems/44888-erorr-while-deploying-to-azure-websites

The suggestion is to do a manual deploy but that’s not a real solution since we’ve been doing automated deploys for over a year now with Octopus and Azure. Hoping someone else can shed some light on this?

Thanks

Hi Bil,

Thanks for getting in touch and sorry to hear you’re having this problem.

To test the connection with Azure during a web-app deployment, we’d recommend installing Visual Studio on your Octopus Server machine and see if the right-click > publish is able to deploy to your Azure web app.

If Visual Studio fails, then you may be able to ask on the Azure support forums to see what they recommend.

If Visual Studio succeeds, but Octopus still gets an exception, then the issue may be with the way Octopus and Calamari syncs your package against your Azure web app. Calamari is open-source, so you can see the calls Calamari makes to the Microsoft.Web.Deployment.DeploymentManager here.

It is this call to the Microsoft library that is returning the exception: Web Deploy experienced a connection problem with the server and had to terminate the connection and is unfortunately outside of our control.

The other support issue you mentioned from last year also had no resolution. We’ve found various forums where people have encountered this issue when deploying to Azure, but none offer a consistent reason/resolution.

Some links that may provide some guidance

The comments in this forum suggest that DNS changes fixed the problem, while others mentioned that having Fiddler running caused this problem.

The comments in this github repo suggested problems deploying to various Azure regions and a problem with the instance counts being set in Azure.

At this point, we have attempted various Azure deployments to various regions, but have been unable to reproduce this problem.

Alternative deployment options

FTP

If none of the above proves helpful, you could look at alternative ways to deploy to Azure web apps with Octopus, without using the built-in Azure step templates. For example, Azure web apps include FTP options, so you could try deploying your package to a temporary location on your Octopus Server (or a Tentacle) and write a script that FTPs the contents of your package to your Azure web app (we got this working using this community step template.

PowerShell cmdlets

Microsoft also have documentation on publishing using the PowerShell cmdlets, which you could investigate as an option. Once you have a proof-of-concept, you could then look at automating the PowerShell calls through Octopus to maintain your deployment automation. However these PowerShell cmdlets also deploy using WebDeploy, so you may encounter the same problems using this method.

Hope this helps

Cheers
Mark