Web deploy


Published on

A presentation on what WebDeploy is, how to configure it, to ease your next deployment.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Today’s presentation is aboutWebDeploy.What is it? Web Deploy was touted at Mix10 as the one-click deployment solution for web applicationsThat’s close to true: it’s a couple of easy clicks to solve a complex issue.…next slide…
  • It’s Microsoft’s solution to deploying websites to UAT and PROD from the comfort of your office.
  • I want to underline the obvious upfront that we’re talking about two parts here…The dev desktopThe remote server on which to deploy
  • Parts of WebDeploy can be used without installing anything anywhere…But the real beauty of it – the remote one click deployment – can only happen after installing stuff on the server.So let’s concentrate on that first.
  • WebDeploy is an addon (not OOB). Which you get from http://www.iis.netI know you guys all know how to install software, so I should say “go download”But I thought it was instructive to show that…Surprisingly, MS does make websites that are functional and easy to navigate (who knew?!)And how easy it is to find the software on IIS with their new Web Platform Installer…But also that …even with the best of intentions…things happen. And not to panic.
  • WhenWebDeploy doesn’t work..... (note that this happened in my case as I had it already been installed)Just Download stuff manually...no biggie...plus it gives more control…and highlights something worth knowing about.Follow the wizard...Aha...An interesting screen: you wouldn’t know it by looking at this...but not everything is availableEither stop and install default server featuresOr even better, run a script.Install everything...DoneThe things we’re installing are (and we’ll cover them more later):“Web Management Service” to install the WMSvc handler used by One-Click Publishing.“Packaging User Interface” will allow you to install packages created in VS 2010 through Internet Information Services Manager (inetmgr.exe).“PowerShellSnapin” adds Power Shell functionality.“Web Management Service” is used by One-Click PublishInstallation Options:The remote service is not started by default and is set to Manual startup. It is only required to have it running during an operation and it can be stopped when not in use.Important note about installing the remote service: You only need the remote service installed on either the source or the destination of a sync. For example, to "push" all content from GoldenServer1 to Client1, Client2, etc., you would install the remote service on all client machines so that the content can be pushed from the source. Alternatively, you could have each client "pull" from the GoldenServer1, and only install the remote service on the source.Offline mode is simply installation of the tool without the service. It requires you to create a local copy of a site or server, then manually copy this “snapshot” or archive to the destination. The tool will be installed to %programfiles%\\IIS\\Microsoft Web Deploy. This cannot be changed.
  • What you get…is new Deployment functionality in IIS.A way to Install Packages Save existing apps, as Packages (easy sharing from one server to another, sharing with the world, etc.)Download from the gallery packages uploaded by others (nuts I know…)…You also get new Management tools:IIS Manager Users (non AD users, with capabilities to manage websites)IIS Manager Permissions (what can they do)Manager Service Delegation…Management Service…
  • Remember the Services mentioned in the Installation Package?You just installed them.But you didn’t turn them on:Have to turn them on from the command line…or from the Services dialog
  • So you’ve just installed the service. So it should be listening, right?How do you know?See if the service is available on website…(all on one line – just folded here for sizing)
  • That lightly touches on what’s been done on the IIS Server side of things:Installation and how to get around issues you may face while doing soTurning on servicesGiving a little test…Meanwhile, back on the Client side, where hardy developers live…
  • Plain old websiteThat references a couple of settingsConnectionStringAppSettingsDefined in the config file.Notice that the app setting is defined in web.config…while connectionString is coming from an external configSource’ed file.Ie: A classic, neatly modular solution, using the configSource attribute (more on that later).
  • Another thing to notice about the website is that we taking advantage of VS2010’s new Web Config Transformations (WCT)Take the time to learn more about WCT :http://msdn.microsoft.com/en-us/library/dd465326.aspxReally: it’s about time…it’s been out a year or more now…TODO: ExamplesTODO: Screen grab of ‘Add Config Transforms’ to existing projects (including 2.0)Don’t need Vstudio – can also build the Transformations from the CommandLine using:MSBuild {ProjName}.csproj /t:TransformWebConfig /p:Configuration=ReleaseBut notice the output:Output dumped to the obj\\Debug\\TransformedConfig\\transformed\\web.config
  • Ok. So we have a website…and we have WCT transformations…We’re all set to give it a go…GO!...Bring up the Package SettingsCheck themWhen satisfied, Build Deployment PackageWatch the command line as to where it goes (obj)Go find the files there (obj/{BUILD}/Package
  • Let’s install that Package – but this first time, let’s do things Manually (not remote deploy):Go back to IISSelect the Zip file that was in the Package dirNotice that the zip is more than just files – but operationsNotice the Advanced button……for the extended features/settings…Enter the Application name in the website you are publishing toFinished
  • Let’s Browse to the website we just published by using IIS’s newly installed Import Application featureNote that depending on the website, might have to edit HOSTS first…no biggie.But once you get to the website…tada!Huge: Notice the Setttings… Transformations occurred!But…Only for web.config (and not the nested configSource referenced files…)
  • Let’s go back to thedev station again…
  • Let’s try that again…but let’s do even better.Let’s improve on the Manual way, and select Publish this time……which brings up settings to publish to website.Notice https://Notice name of websiteNotice Port 8172Notice MSDeploy.axdLet it rip…Notice in the output that it’s doing much more than just zipping up. There’screation, transformation, and publishing…And Notice that it’s not just file manouvers…but ACL, etc.Back on the server…In IIS…notice that website was created.And if we browse to website, we can see results of transformations (or at least web.config)Seriously: time for thunderous applause…You just deployed a website, with ACL’s etc…across the web from the comfort of your chair…Kind of beats trecking out to the client’s, installing packages, passwords, etc.
  • About now, any self-respecting infrastructure guy should be hyperventilating, wondering about the security of all this…TODO: Setting up permissions etc...
  • Remote access made available due to Management ServiceEnabledUsing AD or IIS Manager (more on that in a sec)On port 8172 And SSLAuthentication is by AD, or IIS Manager Users Think of them the same way as SSIS UsersSame pros/ same cons…Might consider sticking to ADYou assign IIS Manager Permissions to specific AD Users on specific Websites (important: not Sites)...eg…you just assing users to website.Finally, you specify what remote users are allowed to do, per site…It’s too deep to go in here, but notice that it’s the same rights we saw in the deploy package operations
  • Publishing is all good...but what if can’t get Infrastructure to install it…or need to do work in-situ (ie…can one do on site transformations without Visual Studio?)Maybe Instead of having Prod Config in the app, how about having it installed on server, out of reach from everyone except person installing it?Cause Vstudio is a bit heavy...you know?Found a project that uses the same syntax – actually uses MS’s assembly underneath.Consideration:think that means .NET 4.0 has to be installed on servers…...So Cool I guess...even though it too therefore has the inability to process configSource referenced files...
  • I’ve studied the problem of how far one can get around the lack of a configSource attribute.Take a look at: http://bit.ly/ekVVdK (It’s a post I wrote on combing folders, configsource, and file attribute) See Xact.Studies.WebDeploy
  • Learn Syntax:http://blog.hmobius.com/post/2010/02/17/ASPNET-40-Part-4-Config-Transformation-Files.aspxhttp://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.htmlhttp://vishaljoshi.blogspot.com/2010/04/xml-document-transform-xdt-snippets-for.htmlUnderstanding why Match can be useful in multi website scenario:http://blog.capaxsolutions.co.uk/2009/11/27/web-config-transformations-in-visual-studio-2010/How to get it to work for other than Websites, and other fileshttp://www.olegsych.com/2010/12/config-file-transformation/http://vishaljoshi.blogspot.com/2010/05/xml-document-transforms-xdt-for-any-xml.htmlhttp://aspalliance.com/2019_Automating_Deployment_with_Microsoft_Web_Deploy_.1Port Forwarding:http://www.wadewegner.com/2010/12/web-deploy-with-windows-azure-on-restrictive-networks/http://learn.iis.net/page.aspx/516/configure-the-web-deployment-handler/http://learn.iis.net/page.aspx/516/configure-the-web-deployment-handler/Learn:http://msdn.microsoft.com/en-us/library/dd483479.aspxInstalling on IIS:http://blogs.iis.net/shanselman/archive/2010/03/24/web-deployment-made-awesome-if-you-re-using-xcopy-you-re-doing-it-wrong.aspxhttp://live.visitmix.com/MIX10/Sessions/FT14
  • Installing:By default, the remote service (MsDepSvc) will listen on http://+:80/MsDeployAgentService/,It is assumed that both Web Management Service (WMSvc)And MSDepSVC are both runningUse net start {svc}http://www.bilalaslam.com/common-web-deploy-connection-errors-and-recipes-for-fixing-them/Works (once SSL setup):c:\\Program Files\\IIS\\Microsoft Web Deploy>msdeploy -verbose -debug -verb:dump -source:apphostconfig,wmsvc=xacts0,authtype=Basic,userName=XACT\\Sky,password=*****2bK
  • CODE APIhttp://blogs.iis.net/jamescoo/archive/2009/11/03/msdeploy-api-scenarios.aspx
  • Web deploy

    1. 1. WebDeploy<br />
    2. 2. What is WebDeploy?<br />The one-click webapp deployment solution<br />The one few-click webapp deployment solution<br />
    3. 3. The Players<br />
    4. 4. On the Server...<br />
    5. 5. http://www.iis.net/<br />Download / Install on IIS<br />
    6. 6. Install on IIS (take 2)<br />http://technet.microsoft.com/en-us/library/dd569059(WS.10).aspx<br />http://forums.iis.net/t/1171432.aspx<br />dism /online /enable-feature /featurename:IIS-WebServerRole<br />dism /online /enable-feature /featurename:IIS-WebServerManagementTools<br />dism /online /enable-feature /featurename:IIS-ManagementService<br />Reg Add HKLMSoftwareMicrosoftWebManagementServer /V EnableRemoteManagement /T REG_DWORD /D 1<br />net start wmsvc<br />sc configwmsvc start= auto<br />Installed to: %programfiles%IISMicrosoft Web Deploy<br />
    7. 7. New IIS functionality...<br />
    8. 8. New Services…<br />//Stop the Services<br /><ul><li>net stop msdepsvc
    9. 9. net stop WMSvc</li></ul>//Change the Service Start Mode from Manual to Auto<br /><ul><li>scconfigmsdepsvc start=auto
    10. 10. Scconfigwmsvc start=auto</li></ul>//Restart the Services<br /><ul><li>net start msdepsvc
    11. 11. net start wmsvc</li></li></ul><li>Check whether svc listening...<br />SET %PATH%=%PATH + ‘c:Program FilesIISMicrosoft Web Deploy’msdeploy -verbose -debug <br /> -verb:dump -source:apphostconfig,wmsvc=xacts0 ,authtype=Basic ,userName=XACTSky ,password=passw0rd<br />
    12. 12. Back at the ranch...<br />...on your trusty dev station...<br />
    13. 13. Create a WebSite to Deploy<br />
    14. 14. Web.Config Transformations<br />MSBuild {ProjName}.csproj /t:TransformWebConfig /p:Configuration=Release<br />http://msdn.microsoft.com/en-us/library/dd465326.aspx<br />
    15. 15. Package the website<br />
    16. 16. The Resulting Package<br />
    17. 17. ...Back at the Server...<br />
    18. 18. Import Package into IIS<br />
    19. 19. The Installed Website<br />
    20. 20. ...back at your dev station...<br />
    21. 21. Installing Remotely<br />
    22. 22. How the heck did it get thru?!<br />
    23. 23. Setting up Permissions<br />
    24. 24. Observations (Q1 2011)<br />Benefits:<br />Continuous Integration<br />“The Future” (Built in, etc.)<br />Considerations:<br />OOTB, only available to WebSites<br />Requires asking for IIS configuration…<br />Can’t do configSource=“…”<br />WCT done at Package Time, not Install Time<br />
    25. 25. Do I need Visual Studio?<br />http://ctt.codeplex.com/<br />configSource = #@!!!<br />
    26. 26. configSource = deal breaker?<br />http://bit.ly/ekVVdK<br />
    27. 27. So: your next deployment…<br />
    28. 28. Links<br />Google.<br />
    29. 29.
    30. 30. WebDeploy on IIS 6 ??<br />A little research helps:<br />How do I setup WebDeploy on Windows 2003 / IIS6? - Stack Overflow http://bit.ly/eYHj6j<br />