« Previous Next »

Thread: MSDeploy: Deploy to server and create virtual directory

Last post 10-01-2009 2:28 PM by rtino. 15 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (16 items) 1 2 Next >

Sort Posts:

  • 04-01-2009, 6:56 PM

    MSDeploy: Deploy to server and create virtual directory

    Is there a way to deploy the contents of a local folder to a remote server and at the same time create a new virtual directory for the content on the remote server using MSDeploy?

    For example, I'd like to use MSDeploy to deploy the contents of "C:\MyWebFolder" to "http://myserver/MyWebApp" (with a local path for the virtual directory of "C:\ServerWebFolder"). The source machine does not run IIS and the source folder is not part of a website; it is just a windows directory with content for deployment.

    Currently, I can sync the content of the source and destination folders using MSDeploy, and I can change the local path of an existing virtual directory (thanks, ninatang).

    The problem is that I don't know how use MSDeploy to create a new virtual directory on the remote server that will map to the destination content path. Is there a way to do this using MSDeploy? Or maybe someone sees a better way to use MSDeploy to do what I'm proposing?

  • 04-01-2009, 10:28 PM In reply to

    • yaminij
    • Top 50 Contributor
    • Joined on 09-25-2007, 12:41 AM
    • Posts 186

    Re: MSDeploy: Deploy to server and create virtual directory

    The iisApp provider in msdeploy is probably what you are looking for. Please take a look at http://technet.microsoft.com/en-us/library/dd569054.aspx

    Thanks
    Yamini Jagadeesan, SDET, Microsoft IIS Team
  • 04-02-2009, 1:03 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    Thanks for the response, yaminij.

    I looked at the iisApp information, but I didn't see how it could perform what I'd like. I also read on that page that iisApp cannot be used to create a site. Maybe I missed something? I think my original post made it sound like the site on the destination server already exists. My mistake.

    To clarify, I'd like to deploy a folder to a remote server and create a new site/virtual directory on the remote server that will map to the destination path. The folder is not in a site / virtual directory on the source machine.

      Example details:
    • IIS version on destination machine: 6.0
    • Source machine name: PC1
    • Source path: C:\MyWebFolder
    • Destination machine name: SRV1
    • Destination path: C:\ServerWebFolder
    • Site/ virtual directory exists on SRV1: no
    • Desired site / virtual directory name: MyWebApp
    • Desired site / virtual directory metakey: lm/w3svc/1/ROOT/MyWebApp
    • Desired site / virtual directory source path: C:\ServerWebFolder

    I think I may have miscommunicated the info in my original post. I hope this clarifies what I'm trying to do.

  • 04-03-2009, 2:39 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    There are two different scenarios:

    1. You have a web site "Default Web Site" on the destination under which you are trying to create a new app "MyWebApp". This can be done.

    msdeploy -verb:sync -source:iisapp=C:\mywebfolder -dest:iisapp="Default Web Site/MyWebApp"

    2. You Do not have a web site on the target and you are trying to create a new web site and then create an app under it as "New Web Site/MyWebApp"

    For this you would have to first create the site from some default site on your local system or the remote box and then create the app under it

    msdeploy -verb:sync -source:apphostconfig="Default Web Site" -dest:apphostconfig="New Web Site",computername=remotePC,username=uid,password=pwd

    msdeploy -verb:sync -source:iisapp=C:\mywebfolder -dest:iisapp="New Web Site\MyWebApp",computername=remotePC,username=uid,password=pwd

    Let us know if you need more info.

  • 04-03-2009, 3:56 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    Thanks, moshaikh.

    The core of my question is regarding "first-time" deployments to servers where there's nothing to sync. Syncing a "placeholder" site/virtual directory on the target server is an option I have considered, but what about creating a new site/virtual directory on a destination machine "from scratch", i.e., without syncing from an existing site or virtual directory? Can MSDeploy be used for "first-time" deployments, not just syncing?

    If I have a new target server with nothing in IIS except 'Default Web Site', can MSDeploy create a new virtual directory on the target server at metakey path: "lm/w3svc/1/ROOT/NewVirtualDirectory" ?

  • 04-09-2009, 6:49 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    Hi Michael,

    Good question. MS Deploy is focused on the sync, instead of first-time deployment. There are a few exceptions like executing SQL scripts, creating an IIS application, etc. It's an interesting request to also add site creation and one that we will consider.

    From a workaround perspective, you could create a sort of "template" package file that contains a generic new site that you have parameterized values for the site's name and physical directory, and use this as a source. Would that be a sufficient workaround or are there things you see missing with this approach?

    For the target server question, we can create a new application at 1/root/newvirtualdirectory. It's basically a vdir except it has a path relative to the root of the site, you can't specify a different path like c:\foo. The provider is iisapp, you can sync from a directory that is just a folder to a vdir that we will create, using the example provided earlier.

    thanks,

    -faith

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 04-13-2009, 5:48 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    Thanks for the follow-up faith, I will continue using the workaround that you mentioned. I would be very impressed if such first-time deployment functionality was included in the release version of MSDeploy, especially considering that I don't get to use some of the cooler MSDeploy functionality because the servers in question are currently running IIS 6.0. :-) Thanks again, Michael
  • 04-16-2009, 3:03 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    I'd also appreciate better "first-time" deployment support.

  • 07-23-2009, 5:56 AM In reply to

    • Jamescoo
    • Top 500 Contributor
    • Joined on 05-02-2008, 1:54 AM
    • Redmond
    • Posts 25

    Re: MSDeploy: Deploy to server and create virtual directory

    Hey Michael.it,  could you give an example or two of some cool functionalities that you don't get to use in MSDeploy because you are using iis6?  I would be interested to know some examples of these and maybe they could be improved on.

    Thanks for any input on this,

    James

  • 09-29-2009, 2:42 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    faith_a:

    Good question. MS Deploy is focused on the sync, instead of first-time deployment. There are a few exceptions like executing SQL scripts, creating an IIS application, etc. It's an interesting request to also add site creation and one that we will consider.

    It's a bit disappointing that MS Deploy only supports the simplest first-time deployment models, especially considering that Visual Studio 2010 will be able to generate packages. We've been evaluating MS Deploy as part of our QA and release chain - it has a lot of promise, but too many missing pieces.

    For example, we were hoping to have our build server generate deployment (zip) packages with manifests that could be deployed to our QA, staging, and production servers to ensure a consistent environment at all points in the chain.

    The two biggest issues that block us from using MS Deploy is the fact you can't create a website from a package, and that there doesn't seem to be many ways to perform advanced configuration "from code" rather than "from an IIS server". For example, application pool settings and WCF website bindings (net.tcp, net.msmq).

    Very frustrating. We'd much rather deploy a package that's been tested at *all* stages of the development process than generate a new "one off" (and untested) package or sync within the production environment.

  • 09-29-2009, 3:20 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    With the RTW release, you can actually create a website from a package, indirectly. What i mean is that you can use runcommand provider to create a site and use it in presync option so that the site gets created and the package gets deployed all in a single step. You can use this from the API too.

    You can also perform application pool settings and bindings from the API and the exe using this and other providers. For an example you can look at this . The example shows creating a site and migrating an application on the source to the newly created site on the target server.

    Let us know if you need any more information that could help achieve this.

    Thanks

     

  • 10-01-2009, 6:19 AM In reply to

    • rtino
    • Not Ranked
    • Joined on 10-01-2009, 6:15 AM
    • Posts 3

    Re: MSDeploy: Deploy to server and create virtual directory

    Hi there,

     I am also trying to use MSDeploy but what i want to do with is doesn't seem possible.

    I have server A with more that 20 websites on it using (c:\inetpub\wwwroot) dir as their homedir, but i want to migrate the websites to another server B which i want to use another diskdrive on D:\inetpub\wwwroot.

    It isn't possible when creating the newly website on server B that you also specify the location of this website (where to sync the files to)

     I hope it is possible and i wasn't looking at the right places ... ;-)

     

    Thanks in advanced...

  • 10-01-2009, 11:17 AM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    This is definitly achievable. All you have to during sync is use a replace rule or setParam to do this.

    The actual rule will depend on whether you are migrating from iis6 to iis7 or iis6 to iis6 or iis7 to iis7.

    You can read more about replace rules here . If you let me know what is the source and destination I can get you the exact command you need.

     

  • 10-01-2009, 11:42 AM In reply to

    • rtino
    • Not Ranked
    • Joined on 10-01-2009, 6:15 AM
    • Posts 3

    Re: MSDeploy: Deploy to server and create virtual directory

    Nice to hear that it's possible...

    These are the specific from one of the sites i want to move:
    Website name in IIS Manager: mywebsite

    Source IP: 192.***.***.120
    Path: C:\inetpub\wwwroot\website_dir

    Destination IP: 192.***.***.110
    Path: D:\inetpub\wwwroot\website_dir

    And it's from iis6 to iis6.

    Hope you can help me out...

    Really appreciate it..

  • 10-01-2009, 1:35 PM In reply to

    Re: MSDeploy: Deploy to server and create virtual directory

    Please remove the sensitive information from your message. You dont need to inform us about that. [edit your message and remove the ip information and the site name]

    msdeploy -source:metakey="yoursitename" -dest:auto,computername="destinationmachinename",username=youruid,password=yourpwd -replace:objectname=metaproperty,scopeattributename=name,scopeAttributeValue=Path,targetAttributename=value,match="C:\\",replace="D:\" -verbose

    OR

    msdeploy -source:metakey="yoursitename" -dest:auto,computername="destinationmachinename",username=youruid,password=yourpwd -replace:objectname=metaproperty,scopeattributename=name,scopeAttributeValue=Path,targetAttributename=value,match="C:\\",replace="D:\" -verbose

    Let us know if you need more information.

Page 1 of 2 (16 items) 1 2 Next >
Microsoft Communities