web deployment with custom requirements using msdeploy - web-deployment

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.

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/

Related

How to use msdeploy to deploy an existing website on remote server

I already created a website "MyWebsite" on IIS on Windows server 2012, the physical path is C:\builds\MyWebsite\wwwroot, there are 1 other folders approot under directory C:\builds\MyWebsite, which is also necessary to make the website run. What I want to do is:
create a new folder C:\builds\MyWebsiteNewBuild in remote server which will be used to put my new build;
dump my new build D:\Release\PublishOutput from my local machine to the remote server, the publish output has 2 sub folders: wwwroot and approot;
change the physical path of "MyWebsite" to the new created folder C:\builds\MyWebsiteNewBuild\wwwroot, and restart the service.
I am new to the msdeploy, I searched and it seems that I can use
msdeploy.exe -verb:dump-source:contentPath="D:\Release\PublishOutput" -dest:contentPath="C:\builds\MyWebsiteNewBuild",computerName="https://**.**.**.**/MsDeploy.axd",userName='administrator',password="*****",authType='Basic' -allowUntrusted
to dump my new build to remote server's destination folder, but the other requirements, such as change the physical path of my existing website, I don't know how to do.
You could change the website path using the appcmd through WebDeploy by using a manifest.
<runcommand path="%windir%\system32\inetsrv\appcmd set app /app.name:"Default Web Site/app12" /[path='/'].physicalPath:C:\temp\app12" waitInterval="5000"/>
http://www.dotnetcatch.com/2016/06/28/webdeploymsdeploy-quick-tip-change-iis-siteapp-physical-path-with-msdeploy/
The following post describes how to create a custom WebDeploy package based on a manifest:
http://www.dotnetcatch.com/2016/06/23/deploy-an-asp-net-website-not-web-application-with-msdeploy/

Web deploy with MSBuild deploys only BIN folder

I have a website project (not a web application) and I want to set up deployment after builds with TFS. I have set this up and got it to work. I set up the build agent machine and the server and also created a publish settings file for the website project.
I know that the publishing agent is communicating with the IIS management service and that all permissions are set correctly, since after a build MSBuild does deploy the bin folder to the target. What I don't understand is why the rest of the website is not copied as well.
I run MSBuild with the following arguments:
/p:DeployOnBuild=True /p:AllowUntrustedCertificate=True /p:PublishProfile=QA /p:VisualStudioVersion=12.0 /p:UserName=[my AD user name] /p:Password=[my AD password]
I know these settings are correct, since the bin folder does get published, but how do I get the rest of the website project to publish as well?
What do you mean with the "rest of the website". Typically all your website assets are compiled into binaries and deployed like that.
If you wish to deploy additional files you can do this in the publish settings in your project properties:

Can an ASP.NET vNext application be hosted in IIS

I'm struggling to workout how to host a local ASP.NET vNext application in IIS. Is this possible currently or is just selfhosting or IISExpress available. Or am I missing the point?
You can use 'kpm pack' to create a package and then drop that in the wwwroot folder. Create an application in the IIS Manager. Refer to the 'using command line' section in the below link to create the packaged web project https://github.com/aspnet/Home/wiki/FTP-deploy-an-AspNet-vNext-application-to-Microsoft-Azure-websites
You can also right click a project in VS14 and click Publish, then choose Filesystem in the dialogue.
Yes, I deployed my app in my local IIS server.
As you can see publish vNext to local system generate two folders approot and wwwroot
You should copy these 2 folders on IIS and specify folder wwwroot as Site Folder

TFS 2010 Build 2 projects in Solution not transforming web.configs

I have two web applications in a solution which is build using TFS.
The main web application's web.configs are correctly transformed depending on the configuration setting of the build.
In the second web application the project is build and deployed but the web.config is not transformed and all transform web.configs are copied to the publish location.
I.e.:
web.config,
web.dev.config,
web.testing.config
In the build settings > Process > Items to build I have added the solution file. The build says "There are 1 projects for 1 platform and configuration" I am not sure if this is correct. Should it not see both my web applications?
How do I set-up the TFS build to transform both projects web.configs?
Which version of TFS are you using? Have a look here anyway as it might answer you: http://nirajrules.wordpress.com/2011/07/04/integrating-web-config-transformations-with-tfs-build/

Deploying ASP.net on IIS in windows 7

I've never actually used IIS, and I'm pretty new to the whole ASP.net thing too.
Basically, I've created a RESTful service using a VS2010 ASP.net project.
I'm not sure how you get that ASP.net application (which runs great on Visual Studio) to run on an IIS server.
It's pretty easy with a Java dynamic web project and Tomcat, but here I'm not sure how to begin.
Do I simply deploy the binaries to a directory?
Thanks!
ther are some possibilities
the easy one
create under c:\inetpub\wwwroot\ a new directory for your app
in the iis manager, configure this directory (create an application, set the right .net version, ... ). than everything you need is to copy all your files into that directory and thats it.
but you can also create a msi file, if you don't have the direct access to the server.
hth
For best testing you application use IIS 7.5 express on you development machine and set this:
project->Properties->Web->Use Local IIS Web Server
After testing under local IIS you can deploy you project to real IIS by using Build->Publish 'Your project'
Simplest way is deploying to File System in some folder and copy its content to created site folder, associated with IIS Virtual directory. To create Sites and virtual directories, see this:
http://www.bloggingdeveloper.com/post/Creating-IIS7-sites-applications-and-virtual-directories-using-Internet-Information-Services-Manager.aspx
http://mvolo.com/blogs/serverside/archive/2007/07/12/Creating-IIS7-sites_2C00_-applications_2C00_-and-virtual-directories.aspx

Resources