Auto Deploy using Continuous Integration in TFS 2012 - deployment

I have setup continuous integration for a WCF project and want to use the MSBuild Arguments to automatically deploy the application to a remote server but it is not deploying.
When running a new Build all the Tests pass and all the projects build but the website is not being deployed. Also, I am getting no errors back from the build to say anything has gone wrong.
I have opened up port 8172 on the remote server to ensure connections can be made to IIS and have even disabled the firewall.
In the Build Configuration I have specified the following arguments;
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:DeployIisAppPath="Default Web Site/MYSite" /p:MsDeployServiceUrl=http://mysite.com /p:username=MySite\Administrator /p:password=thePassword
I compiled this configuration from the following examples:
http://vishaljoshi.blogspot.co.uk/2010/11/team-build-web-deployment-web-deploy-vs.html
http://www.chrissurfleet.co.uk/post/2011/07/21/Setting-Up-Continuous-Deployment-In-TFS.aspx
I have configured the Server's IIS to enable remote connections and I can Remotely administer IIS from the build server. Also I have successfully deployed the Application using Visual Studio 2012 Publish option.
can anyone see a problem with my MS Build Arguments? Am I missing anything?
Any help would be very grateful
Update:
I have checked the build server to check MS deploy is installed and have installed Web Deploy 3.0 to ensure this is capabale, but has not solved my problem.
I have check the IIS connection logs to see if the remote connection to IIS is being made and there is no connection being made from my build server to the app server.
I have tried running MSBuild.exe for the solution and project on the build server manually with the following:
MSBuild.exe "Project Location" /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=WMSVC /p:DeployIisAppPath="Default Web Site/app" /p:MsDeployServiceUrl=http://appserver:8172/MSDeploy.axd /p:AllowUntrustedCertificate=True /p:CreatePackageOnPublish=False /p:Username=username /p:Password=password
The MSBuild is successfully building the project but is making no attemp to deploy it.
Any Ideas?

Turns out the problem was files were missing on the Build Server as desibried in the Answer to this question:
Similiar problem
Also when installing Web Deploy 3.0 using Web Platform installer not all the features required are installed in order to connect remotely to IIS through MSBuild command line.
I copied the nessesery files from my dev machine to the build server and installed Web Deploy 3.0 manually with all features and this now works!
Maybe there is a bug with TFS 2012???

Related

How deploy .NET Core web application via Visual Studio Team Services to hosting with IIS

I would like to deploy my .NET Core web application via Visual Studio Team Services to hosting with IIS.
I have tried to discover the possibility of deployment the final release but I don't know what type of task I can use.
I usually used the deploy via Visual Studio 2017 and using publish proccess with MSDeploy and setup profile like this:
<publishData>
<publishProfile
publishUrl="publishUrl"
msdeploySite="site"
destinationAppUrl="destinationAppUrl"
profileName="Default Settings"
publishMethod="MSDeploy" userName="login" />
</publishData>
This site is not running on azure but on shared asp.net hosting.
How can I setup the Visual Studio Team Services - Deploy release if I only know these information?
What type of task is necessary to use?
Since you can deploy it with publish profile, you can to do it in VSTS build/release too.
NuGet restore (2.*) or Dotnet restore task
Visual Studio Build task (MSBuild Arguments: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="[profile name]"
You can use IIS Web App Deployment Using WinRM tasks if you have admin account.
If the host supports FTP, you also can upload the published files through FTP task.

VSTS IIS Web App Deploy fails with return 2148734720

I configured releases same way for a couple of our servers but I have issue with one of them (others work perfectly):
[error]Failed to deploy web package to IIS website.
[error]Error: C:\vstsagent\A2_work_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.0.20\MSDeploy3.6\msdeploy.exe failed with return code: 2148734720
Unfortunately I can't find anything helpful related to this error Code.
My release configuration:
IIS Web App Deploy (Preview)
Deployment group with one specific staging server (I'm using on-premise agent)
Website name: correct name of my website in IIS
Virtual Application: empty field
Package of Folder: zip chosen from build drop artifacts
Selected "XML variable substitution"
Selected "Remove Additional Files at Destination"
What I've already tried with no luck:
manually turn of application
delete all files in application folder
changing user account to use for the service
Again - same configuration for other servers works fine.
Servers configuration: Windows Server 2012R2 Standard x64
Looks like I figured it out. .NET Framework 3.5 was missing on my server...
I was investigating logs and I found out that below line is causing failure.
"C:\vstsagent\A2\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.0.20\MSDeploy3.6\msdeploy.exe" -verb:sync -source:package='C:\vstsagent\A2\_work\r2\a\temp_web_package_8269135298977384.zip' -dest:auto -setParam:name='IIS Web Application Name',value='httproot'
So I copied it to CMD and got proper Windows message when I tried to execute it.

Deploy asp.net web app on local or remote IIS using PowerShell DSC

I am unable to find any help on how to use PowerShell for DSC and deploy asp.net web app on local or remote on premises IIS.
Can you please help me with the steps or any resources?
What's your preferred method of deploying code prior to using DSC? xRobocopy was created with this scenario in mind, but if you are packaging your solution using NuGet, you could also use the PackageManagement resource.
I started working on a NuGet based config script recently but it isn't ready to publish in the gallery yet:
https://github.com/Microsoft/NuGetIISAppServerConfig/blob/master/NuGetIISAppServerConfig.ps1

Eclipse - Why does Azure deployment take so long

I'm trying to deploy my HelloWorld application in Windows Azure which was developed in Java using eclipse. The application working fine when I tested under tomcat and Azure sdk. I created hosted service in Window Azure Management Portal and deploy my application. It almost 3 hours and it still deploying.
I went to What Happens When You Deploy on Windows Azure? and checked but still unclear.Can anyone advice why it took so long to deploy and any suggestion how to make the deployment process more faster.
Please refer the image below.
I changed the startup.cmd, instead of copy my tomcat to azure i changed the startup.cmd to download the tomcat online. now its working fine.
Does you start-up script finish after tomcat start?
The instances will be marked as ready only after the start-up script finished, so if you start tomcat blocking the start-up script it won't reach this state unless tomcat crashes...
You should use "start" (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true) command to start tomcat in a separated process allowing the start-up script to finish.
(In my memories the provided example in the eclipse plugin had the issue)

Deploy web applications and windows services using TFS 2010

Just went from TFS 2008 to 2010 at a client site and now wondering what happened to the TFSBuild.proj files from the TeamBuildTypes folder. I've already got the builds and drops working and now I need to get the old deployments working again. We used to do this with AfterBuild targets in the TFSBuild.proj. That mechanism seems to have moved or disappeared in 2010.
Can anyone point me to an article or describe how the deployment options have changed in 2010?
Specifically, I need to support running psexec to install and enable Windows Services on remote deployment targets and I need to deploy some web sites / web services to remote IIS nodes as part of the automated builds.
EDIT: Just found this: http://blogs.msdn.com/jimlamb/archive/2009/11/03/upgrading-tfs-2008-build-definitions-to-tfs-2010.aspx I'm more than a little taken back by the breaking changes between 2008 and 2010. I'm gonna need advice on how to deploy remote sites and services in the new default build process template mechanism.
Check out Vishal Joshi's PDC talk on Deploying Web Applications with VS 2010 and MSDeploy. On his blog, you'll also find tips on building MSDeploy packages with MSBuild. You can run psexec from your MSBuild script or, potentially, from a customized build process template. With TFS 2010, you can use MSBuild and Windows Workflow to solve your build automation problems.
Alternatively, you can use the "Upgrade" build process template and continue using your TFSBuild.proj file. This is the default behavior for upgraded build definitions for backwards compatibility. In that case, your build is still primarily driven by MSBuild with just a thin workflow to allocate an agent and run MSBuild.
Another option is to use TFS 2010 Build Agent on the server that you deploy to. This is how Visual Studio Lab Management deploys.
I have written a blog post about this: Continuous deployment with TFS 2010 Build Agent