Azure Web App Deploy

I’ve recently been deploying to and Azure Web App using the Azure Web App Deploy step template.

I get this error constantly…

Microsoft.Web.Deployment.DeploymentDetailedException: Could not connect to the remote computer ("<site>.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. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
09:31:39Error
   at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
09:31:39Error
   --- End of inner exception stack trace ---
09:31:39Error
   at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
09:31:39Error
   at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext, Nullable`1 syncPass, String syncSessionId)
09:31:39Error
   at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId)
09:31:39Error
   at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
09:31:39Error
   at Calamari.Azure.Deployment.Conventions.AzureWebAppConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\AzureWebAppConvention.cs:line 54
09:31:39Error
   at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
09:31:39Error
   at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28

I’ve found that if I kill the scm service on Azure via Kudu I can deploy the next time.

Has anyone seen this before and have a solution or workaround?

Hi Dustin,
Having a bit of a google around the interwebs this sounds like it may be a problem with Azure publishing


https://social.msdn.microsoft.com/Forums/en-US/efa56eb2-a8b2-4690-92d0-33d97946ed29/cant-deploy-could-not-connect-to-the-remote-computer-xxxscmazurewebsitesnet-using-the?forum=windowsazurewebsitespreview
It sounds like as a workaround, you can set the WEBSITE_WEBDEPLOY_USE_SCM = false in the Azure Management Portal settings so that the shared Web App Publisher Role performs your deployment rather than a dedicated process.
Could you give this a go and let me know if it gets you deploying again.
Cheers,
Robert

I looked at those. The only issue with that change is the deploy Url in the publish settings file is different than the one used by the Azure web app deploy step from 3.1.

Before 3.1 I used the MSDeploy step with WEBSITE_WEBDEPLOY_USE_SCM = false and it seemed to be fairly reliable.

Hi Dustin,
So to confirm, did you say that you currently are using WEBSITE_WEBDEPLOY_USE_SCM = false and its still failing?
Robert

I am not. That setting changes the msbuild publish settings file you
download from the azure portal.

The publish URL that you deploy to changes.

I think the step template might need to support that second URL.

Hi Dustin,
Looking at the Calamari code it looks as though we are pulling down the publish settings at deployment time and as a result, any changes from this configuration element should immediately flow through. Could you please give this a try with the changes made to your configuration and let me know if this has any affect.
Cheers,
Rob
Robert

I’ll absolutely give it a try. I didn’t realize the Calamari code was on
Github or that the deploy settings were downloaded every time.

Thanks,

Dustin Chilson

After a few weeks of trying this out the errors have resolved by using the suggestion above.

WEBSITE_WEBDEPLOY_USE_SCM = false