We recently released Beta1/Go Live version of "Microsoft Web Deployment Tool (aka MSDeploy.exe) ". MSDeploy is a very useful tool for creating web packages which can be used to move your web application from developer boxes to servers. It can be used to replicate servers in web farm environments too.
Download Location: You can download MSDeploy.exe from the below location:
http://iis.net/downloads/default.aspx?tabid=34&g=6&i=1602
Earlier I had written about the Technical Preview release of MSDeploy here. Apart from the features I had mentioned in the above post following are other key features worth noting are:
MSDeploy Remote Agent: MSDeploy comes with a remote agent service. This service can be optionally installed with MSDeploy and usually is intended to be installed on the server side. MSDeploy on your Dev/Test box can talk directly to the remote agent on the server and help move your IIS6/IIS7 web to equal or higher version of the webs on the server.
Below is an example of how you can move an IIS 6 site from one machine to another.
MSDeploy.exe -verb:sync -source:metakey=lm/w3svc/1,computerName=VJWin2k3 -dest:metakey=lm/w3svc/2
Web Archive/Package: MSDeploy can actually take a snapshot of your app from the local machine and move it to what we call as Archive Directory. This will allow you to eventually take the Archive Directory on a different machine and use MSDeploy command line with elevated privileges to install your web on the server. This can potentially solve a very common problem of developers not having admin rights on the server. Developers in this scenario can run MSDeploy on your local IIS and create archive dir for their web. This can be done from command line in the following way:
(command: msdeploy -verb:sync -source:appHostConfig="Default Web Site" -dest:archiveDir="V:\Vishal\Archive")
This Archive dir can then be shared with the server Admins who can examine the content of the archive dir by executing the following command:
msdeploy -verb:dump -source:archiveDir="V:\Vishal\Archive"
Now the admins can actually install the website from this archive package on to the production server. This can be done by executing a command like below:
msdeploy -verb:sync -source:archiveDir="V:\Vishal\Archive" -dest:appHostConfig="Production Web Site"
On executing this command the "Production Web Site" will get installed (as shown below) and will be stopped by default. Admin can then turn it ON as appropriate.
I thought that apart from talking about the above feature referencing the New Features of this release from the "Read Me" file would be useful, so here are the extracts from the Read Me file...
-
PowerShell Support. PowerShell cmdlets are included, allowing you to use the Microsoft Web Deployment Tool conveniently with PowerShell. For more information about how the PowerShell cmdlets work, see the Help file as well as the Microsoft Web Deployment Tool Walkthroughs.
-
Enhanced Dependency Support. The dependencies that are checked for a web site or server can now be viewed on IIS 7.0 as well as IIS 6.0. They can be turned off on a granular level, such as disabling the drive space dependency check while still running the other dependency checks, or disabling the check for a single ISAPI script map. Additionally, when you view dependencies, you will be able to see the “trigger” for the dependency (what location(s) in configuration caused the Microsoft Web Deployment Tool to say that the module/component is a potential dependency).
-
Help file included in Setup. You can now see the full list of verbs, parameters and other detailed information about the Microsoft Web Deployment Tool in our .chm Help file, which will be included when you install the tool."
In the future posts on this topic I will write more about various other features of MSDeploy and how they can serve some of your web deployment needs.
Hope this was useful!!
6 comments:
Hi Vishal,
I was looking for this!!What about a plugin for VS 2008, similar to web deployment plugin for VS 2005?
Regards,
Satheesh
www.codedigest.com
I donot quite understand what is lm/w3svc/1, why not 0, 2 or 3? Can you explain the meaning of it more clearly?
lm/w3svc/1 is IIS metabase path to Default Web Site... You could have 2, 3 etc based on what is the path ID for your corresponding web site... You can learn more about it at http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/44a57859-8fbb-4238-a7b5-f10c34cf8fe8.mspx?mfr=true
Question 1: We have production, staging and Development environments. We deploy our applications to these different environments. We have environment dependent encrypted sections in web.config file for each web application. We store these encrypted sections in different xml files. e.g. Devlopment.config, Staging.config and Production.Config.
MS Deploy provides us –setParam provider to update web.config file but we need to specify value in the command itself when we use -setParam.
• What if we want to read values from some custom xml file like staging.config to update web.config file? Can you please let us know how this can be done using MS Deploy commands? We will really appreciate if you please provide us with some examples.
Question 2: All our applications on IIS 6.0 are under “Default Web Site”. On IIS 7.0 we don’t want these applications under “Default Web Site”. On IIS 7.0 we want separate Web Site for each application when we migrate from IIS 6.0 to IIS 7.0.
For example we have App1, App2 and App3 under “Default Web Site” on IIS 6.0. We want separate web site APP1, APP2 and APP3 on IIS 7.0
MS Deploy provide us manifest object type. We can write following ms deploy command to migrate application but it will get migrated to “Default Web Site”
msdeploy –verb:sync –source:manifest=D:/custom.xml –dest:auto,computername=iis7serverName.
• What will be the single MS Deploy command if we want to migrate/synchronize applications which are under “Default Web Site” on IIS 6.0 with its application pool, assemblies that need to be GACed with this application, to separate Web site on IIS 7.0?
We want to know what will be single MS Deploy command for question 1 and question 2. Or what needs to be done to achieve this?
You cannot directly sync an application to a site that does not exist. But you can do a two-step process to first sync a site without any apps, then sync App1 to the root of the site. It accomplishes what you are looking to do.
1) Sync a web site from IIS6 to IIS7, but skip syncing all the apps under the site
msdeploy.exe -verb:migrate -source:metaKey=/lm/w3svc/1 -dest:metaKey=/lm/w3svc/4,computername=webserver01 -skip:objectName=metaKey,absolutepath=/lm/w3svc/1/root/.+
2) Now, sync the app itself to the root of the site you just created
msdeploy.exe -verb:migrate -source:metaKey=/lm/w3svc/1/root/vdir1 -dest:metaKey=/lm/w3svc/4/root,computername=webserver01
Alternately, you can have step 1 be an appcmd.exe command to create a new web site, then do step 2.
For Web.Config transformation from dev to testing to staging to production check out web.config transformation post at http://tinyurl.com/webconfigtransform... The information in the link will help you change your web.config files in VS 2010, if you do not have VS 2010 just yet then MsDeploy has parameterization features...
In the future release of MsDeploy there will be options to provide parameters in a file and you can create parmaters for web.config items which can be changed during the time when package is installed...
Post a Comment