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:
C:\builds\MyWebsiteNewBuild
in remote server which will be used to put my new build;D:\Release\PublishOutput
from my local machine to the remote server, the publish output has 2 sub folders: wwwroot
and approot
;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"/>
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/