Thursday, January 19, 2012

Continuous Integration( Part Four) : Deploy Web Application to a Remote machine Using MSDEPLOY

As I mentioned in my previous blog bost  there is a better option for deploy a web application in to a IIS location through MSDeploy command line tool rather than using XCOPY. In this post I am going to brief the issues I encounter during web deployment phase and the steps I followed to overcome them.

Issue 1:
When I package my web application from my local machine it creates a MVC-Client.deploy.cmd file which is referring MSDepoly path as :
                 MSDeployPath="C:\Program Files\IIS\Microsoft Web Deploy V2\"
But In the build server machine (Locate in same network) it creates a MVC-Client.deploy.cmd file which has MSDepoly path as
                MSDeployPath="C:\Program Files (x86)\IIS\Microsoft Web Deploy\"

And I have both versions of MS Web Deploy installed on both machines. But there was an issue when I try to deploy web application to the the web server from the build server machine.
                MVC-Client.deploy.cmd /y /M:es-websrv01/MSDeployAgentService
Reason is it refers version 1 instead of version 2. And I can garentee you that I have same MSBuild versions in both my local machine and build server machine. I dig a bit about this issue and I found that we need to install VS2010 service pack one to generate the working MVC-Client.deploy.cmd file. In my development machine i had it and on the build server machine it has not installed. Installing VS2010 service pack 1 fixed this issue.

Issue 2:
Permission Issue
In my case Jenikings is running as a windows service which initiates by a local user(Not In the Active Domain) in the build server machine(Windows NT ). But in order to do the remote deployment that user should have admin privileges in the target remote machine(es-websrv0). So what I did is just add a user in to the AD with the admin privileges for es-websrv0 and did the deployment

Another permission issue I encounter is we cant do the remote deployment from the Programs files folder in C:/ since it has special permission level.  

Issue 3:
Required Softwares which should be installed in target web server machine.
As I notice there are two ways of do the remote deployment as follows make sure that you have installed corresponding soft-wares on the destination machine.
M: Destination server name or Service URL
    If this flag is not specified, the package is installed on the computer where the command is run. The Service URL can be in the following format:
    This format requires that IIS 7 be installed on the destination server and that IIS 7 Web Management Service(WMSvc) and Web Deployment Handler be set up.

    The service URL can also be in the following format:
    This format requires administrative rights on the destination server, and it requires that Web Deploy Remote Service (MsDepSvc) be installed on the destination server. IIS 7 does not have to be installed on the destination server.

No comments:

Post a Comment