0
votes

I'm having issues deploying an asp.net mvc 4 project from the buildserver to Azure.

We have one azure web site (strictly with nothing deployed to it directly), with a number of Apps deployed in virtual directories underneath. It is with these apps / virtual directories I'm having problems deploying to.

I can deploy direct to Azure from within VS using publish profiles, and also from a batch file which uses publish profiles locally, but it sounds like you cannot use publish profiles on a build server, so I'm using the same settings to fire MSBuild with parameters instead.

The error being returned is:

error : Web deployment task failed.(Could not complete the request to remote agent URL 'http://[site].scm.azurewebsites.net:443/MSDEPLOYAGENTSERVICE'.)

Note this first error lists the main site, not the virtual directory, though this is the value from the .pubxml file that works through VS. Other errors listed after the first (above) are..

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(3847,5): error : This error indicates that you cannot connect to the server. Make sure the service URL is correct, firewall and network settings on this computer and on the server computer are configured properly, and the appropriate services have been started on the server. 

error : Could not complete the request to remote agent URL 'http://[site].scm.azurewebsites.net:443/MSDEPLOYAGENTSERVICE'.
error : The underlying connection was closed: An unexpected error occurred on a receive.
error : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

..and the batch file including the msbuild commands & paramaters is..

msbuild projectname.csproj 
/P:Configuration=DevDeployMyApp 
/p:DeployTarget=MSDeployPublish 
/p:DeployOnBuild=True 
/p:MsDeployServiceUrl=[Site].scm.azurewebsites.net:443
/p:AllowUntrustedCertificate=True 
/p:VisualStudioVersion=11.0 
/P:CreatePackageOnPublish=True 
/p:username=[user]
/p:Password=[password]
/p:DeployIisAppPath=[site]/[VirtualDirectoryName]
/p:MSDeployPublishMethod=RemoteAgent 
/p:IgnoreDeployManagedRuntimeVersion=True

Any ideas?

1
I'm not sure if using virtual directories is the best option to deploy separate web applications to Azure. If you want to continue using this setup then you might also want to consider using deployment via ftp. Your website is accessible trough ftp and credentials for that can be managed using the Azure portal.dannl
It's been working like a charm from my dev PC, but the party stopped when trying to deploy via the Build server. I'll have a hunt now to see how I can deploy via FTP.. Ultimately I just want to be able to deploy automatically via the build - I don't care how :) Thanks.Fetchez la vache

1 Answers

1
votes

Is your service is already running, try going into the Azure portal and stopping it before publishing. That sometimes helps get it unstuck.