web deployment with custom requirements using msdeploy

516 Views Asked by At

I have 2 .net Web projects Project 1 and Project 2. I am using MSDeploy to deploy both the projects on the IIS using command line (script). I want to create structure like below while deployment to IIS

On IIS

  • Default Web site\MySite\Project 1
  • Default Web site\MySite\Project 2

Project 1 contains 10 folders inside it for example folder 1 , folder 2, ....,folder 10 I want convert folder 6 as the virtual directory having different physical path (pointing to Project 2) contents.

I am using below MSDeploy command

msdeploy.exe -verb:sync -source:iisApp='D:\Deployment\UI',includeAcls=true -dest:iisApp='Default Web site\MySite\Project 1',computerName="http://xx.xx.xx.xxx:80/MSDeployAgentService",username=xxx,password=xxx

Using the same MSdeploy command for Project 1 and project 2 both. How can I achieve above requirements.

1

There are 1 best solutions below

2
On

You can use the createApp provider to convert a folder to an app. Regarding the physical path change, your best option is to use the runCommand provider to call appCmd to edit the physical path for the site/app.

http://www.dotnetcatch.com/2016/06/28/webdeploymsdeploy-quick-tip-change-iis-siteapp-physical-path-with-msdeploy/