Showing posts with label Web Deploy. Show all posts
Showing posts with label Web Deploy. Show all posts

Thursday, 16 May 2013

Continuous Integration - TFS Build web deploy

I have been working on web development for a while no wand using TFS 2010 and 2012.
For a while I am using "web deployment" functionality.

In this article I make the assumption that:
  1. You know how to setup TFS build.
  2. You have setup MS Deploy on your IIS application.
  3. Your are using IIS 7 or higher

To create next step in CI is to have build server deploy your latest version of code to the website.

I am using default build template for this deployment.

Make sure that Web deploy is installed on the server (TFS and deployment)
Note: I am using version Web Deploy 3.0




From the picture you can see default build configuration.

I am using MSBuild arguments in order to realize my deployment.

Now the arguments you need to provide to be able to create deployment.
 
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=InProc /p:CreatePackageOnPublish=True /p:MSDeployServiceUrl=localhost /p:DeployIisAppPath="Your Project App Name" /p:UserName=domain\user /p:Password=userPassword

I have had few attempts to do this right, but the most important issue I have had is:
  1. Too long output drop folder in build configuration ( file path exceeded 248 characters)
  2. Insufficient write permissions. This was due to account that is running build did not had write access to folder. Do not let it fool you, account that does the publishing has to have access rights to write into the folder.  Alternative is web deploy service has to run under account that has write privilege to write into target folder. 





Wednesday, 30 January 2013

Web deployment task failed An error occurred when the request was processed on the remote computer.


Yesterday I have been trying to publish latest updates onto server and found error, when using web deploy method of publishing new release.

I have pressed next and I get following error.


Web deployment task failed. ((30/01/2013 19:43:59) An error occurred when the request was processed on the remote computer.)



Steps I took to find the error.
Log in onto your web server and open event log.
Find logs that are for source Web Deploy

You should find something as:

With detail



Please note the red underlined lines that describe issue.
Now note the account that web  deploy is using to update data on your server. It is the one in blue rectange.

Ok, we have identified that the user account has expired.

Go to server manager and update account to remove account has expired and set account to never expire.




 Try deployment again, and publish has succeded.

Friday, 21 December 2012

Web deploy: ERROR_DESTINATION_NOT_REACHABLE.

I wanted to use web deploy from my development PC and build server to the test environment and to production if needed. I have been getting really annoying message:


Web deployment task failed. (Could not connect to the remote computer ("192.168.110.211"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)

Great, So what do I do now?

I have checked whether the web deploy is actually installed on my server and I have verified that it is.
As next step I have turned off my firewall and firewall on the server as the message says, not reachable right?.  Test it again and no success.

As next step I have found following guide:
 http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy

From where I have copied steps below:

Trouble-shooting Common Issues:

  • If you are upgrading an existing installation of Web Deploy, make sure to restart the handler and agent services by running the following commands at an administrative command prompt:
  • net stop msdepsvc & net start msdepsvc
  • net stop wmsvc & net start wmsvc
  • Make sure your firewall allows connections to the service you are using. By default, the Web Deployment Agent Service (MsDepSvc) listens on port 80, and the Web Management Service (WmSvc, also called the "handler") listens on port 8172 by default.
  • You must run MsDepSvc by using the built-in Administrator account, or from a domain account that has been added to the Administrators group. A local administrator which is not the built-in account will not work with MsDepSvc.
  • Check to see if .NET 4.0 has not been registered with IIS: Symptoms: .NET 4.0 is installed, but there are no .NET 4.0 application pools or handler mappings in IIS. You cannot browse to applications that use .NET 4.0 (for example, applications based on WebMatrix’s site template applications) after you publish them.
    Cause: Your machine had .NET 4.0 installed on it before IIS was installed.
    Solution: Run the following command to register .NET 4.0 with IIS: %systemdrive%\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -iru


 I only needed to restart all services (first 3 steps) and preview and confirm is working.