Using msdeploy.exe to deploy folder to remote site

msdeploy

I am trying to find the right parameters for msdeploy.
I have a folder with my web content that I want to deploy.

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3"\msdeploy.exe -verb:sync -source:contentPath="c:\work\WebPackage" -dest:contentPath="Default Web Site",computername="http://10.7.5.93",username='\localuser',password=aPassword

I am getting this error:

Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the remote computer ("10.7.5.93"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Deployment Agent Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: Unable to connect to the remote server
Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.7.5.93:80
Error count: 1.

Unable to figure out the right syntax. I can deploy from VS with this publish file:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>https://kitostest.miracle.dk</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <MSDeployServiceURL>http://10.7.4.93</MSDeployServiceURL>
    <DeployIisAppPath>Default Web Site</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>\deploy</UserName>
    <_SavePWD>True</_SavePWD>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>True</EnableUpdateable>
    <DebugSymbols>False</DebugSymbols>
    <WDPMergeOption>DonotMerge</WDPMergeOption>
    <PublishDatabaseSettings>
      <Objects xmlns="">
        <ObjectGroup Name="KitosContext" Order="1" Enabled="False">
          <Destination Path="" />
          <Object Type="DbCodeFirst">
            <Source Path="DBMigration" DbContext="Infrastructure.DataAccess.KitosContext, Infrastructure.DataAccess" MigrationConfiguration="Infrastructure.DataAccess.Migrations.Configuration, Infrastructure.DataAccess" Origin="Configuration" />
          </Object>
        </ObjectGroup>
      </Objects>
    </PublishDatabaseSettings>
  </PropertyGroup>
  <ItemGroup>
    <MSDeployParameterValue Include="$(DeployParameterPrefix)KitosContext-Web.config Connection String" />
  </ItemGroup>
</Project>

And a screen shoot off the deploy parameters:
enter image description here

So I need to find a way to map the parameters to msdeploy.

This is from my last attempt:

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3"\msdeploy.exe -whatif -verb:sync -source:contentPath="C:\work\WebPackage" -dest:contentPath='M:\Website',ComputerName="http://10.7.5.93/msdeploy.axd?site=Default Web Site",UserName='\ALocalUser',Password='MyPassWord',AuthType='Basic'

Syntak is taken form the article How to publish the contents of a folder with msdeploy.exe
Syntax for contentPath

I got it to work!!! I used fiddler to spy on visual studio when doing a web deploy. it was calling my site as site/MSDEPLOYAGENTSERVICE instead of site/msdeploy.axd. I was not the one installing msdeploy on the web server but if I read the manual then I could have saved myself 5 hours of frustrations.

Best Answer

Looks like there is no "Default web site"? Try adding the site name you publishing to:

msdeploy.exe -verb:sync -source:contentPath="..\WebPackage" -dest:auto,computername="http://10.7.5.93/msdeploy.axd?site=name_of_your_site",username=aUserName,password=aPassword 

Depends how the contents have been created you might need another changes in your msdeploy line but I would try that first.