msbuildmsdeploywebdeploymsbuild-wpp

msdeploy cannot reach destination despite having web deployment service started


as you can see from the title I am experiencing some trouble deploying to a remote IIS. Here is what I have done so far:

"Web Deployment Agent Service" and "Web Management Service" started and running

both local Administrator and iisman have access to the site I want to deploy to

Now deploying itself works when I do it like this for example:

msbuild D:\Path\ToProject\DeployVariation01\DeployVariation01.csproj
        /p:Configuration=Debug;
        Platform=AnyCpu;
        DeployOnBuild=true;
        DeployTarget=MSDeployPublish;
        MSDeployServiceURL="Some.IP.-.Address";
        DeployIisAppPath="DeployAppDebug/DeployThis";
        MSDeployPublishMethod=WMSVC;
        AllowUntrustedCertificate=true;
        Username=Administrator;
        password=<thinkOfAPassword>

Then the application is deployed and I can call it from my browser.

UPDATE: It also works with this command, so that should answer James Woolfenden's question of whether I have access to the msdeploy webservice:

msbuild D:\Path\ToProject\DeployVariation01\DeployVariation01.csproj
        /p:Configuration=Debug;
        Platform=AnyCpu;
        DeployOnBuild=true;
        DeployTarget=MSDeployPublish;
        MSDeployServiceURL="https://some.ip.-.address:8172/MsDeploy.axd;
        DeployIisAppPath="DeployAppDebug/DeployThis";
        MSDeployPublishMethod=WMSVC;
        AllowUntrustedCertificate=true;
        Username=Administrator;
        password=<thinkOfAPassword>

But, I want to use the PackageWeb-Approach (also described here).
So I create a WebDeploy-Package from Visual Studio 2012, which I want to deploy. Deploying this generally seems to be no problem, too, since I get it to run on my local computer.

Both, my local IIS as well as the one in my VM have the same WebSite-Structure, so I just should have to change "Computer name", "Username" and "Password" when calling the Publish-Interactive.ps1-script in order to get it to work, but when I do that I keep getting the error message

Could not connect to the remote computer ("Some.IP.-.Address")
On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)

But that confuses me, because I actually have Web Deploy installed via WebPlatformInstaller and the Web Management Service is running. I also tried to ping my VM from my host machine and it is getting through. For testing purposes I switched off the firewall in my VM entirely, too.

All firewall profiles are switched off

But still I get the same error message.

Can anyone guide me towards the right direction? What am I missing?


Solution

  • It turned out, the problem I am having here has nothing to do with my server configuration, service account or any other account configuration on my remote machine whatsoever.

    The services DO work as they should.

    It seems that I either set up my script in the wrong way or it is not working properly. As I looked into the execution of the script I saw that at the end this command was created and tried to execute:

    "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
        -verb:sync -source:archiveDir="C:\Users\someName\AppData\Local\Temp\DeployDBVariantion00_zip" 
        -dest:auto,includeAcls='False',ComputerName='some.ip-.address?site=DeployApp/DeployThis',Username=someOtherName,Password=haveAnotherGuess,AuthType='BASIC'
        -disableLink:AppPoolExtension
        -disableLink:ContentExtension
        -disableLink:CertificateExtension
        -setParamFile:"C:\Users\someName\AppData\Local\Temp\DeployDBVariantion00_zip\SetParameters.xml" 
        -skip:objectName=dirPath,absolutePath="_Deploy_"
        -skip:objectName=filePath,absolutePath=web\..*\.config
        -skip:objectName=dirPath,absolutePath=_Package
        -skip:objectName=filePath,absolutePath=.*\.wpp\.targets$
        -allowUntrusted
    

    But for this command to work the ComputerName-Parameter needs to include the full address to the target service AND the application name under the IIS site must not be included, so modifying it a bit into this

    "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
        -verb:sync
        -source:archiveDir="C:\Users\someName\AppData\Local\Temp\DeployDBVariantion00_zip" 
        -dest:auto,includeAcls='False',ComputerName='https://some.ip.-.address:8172/msdeploy.axd?site=DeployApp',Username=someOtherName,Password=haveAnotherGuess,AuthType='BASIC'
        -disableLink:AppPoolExtension
        -disableLink:ContentExtension
        -disableLink:CertificateExtension
        -setParamFile:"C:\Users\someName\AppData\Local\Temp\DeployDBVariantion00_zip\SetParameters.xml"
        -skip:objectName=dirPath,absolutePath="_Deploy_"
        -skip:objectName=filePath,absolutePath=web\..*\.config
        -skip:objectName=dirPath,absolutePath=_Package
        -skip:objectName=filePath,absolutePath=.*\.wpp\.targets$
        -allowUntrusted
    

    then did the actual job of deploying to my remote machine. I also posted about this in more detail here, because my problem now went from a server configuration problem to a script configuration problem ;)