I\'m integrating MSDeploy into my build process, and having problems authenticating. The following command works fine:
msdeploy -verb:sync -source:appHostConfig
Figured It Out!
So, it seems that (at least by default), WMSVC only listens on HTTPS, and HTTP will just time out. However, since my certificate was self-signed, I had to use the -allowUntrusted command line option.
That was almost enough. I also had to specify authType=Basic like Richard originally suggested. So, to put it all together, this is the MSDeploy command line that will actually work:
msdeploy -verb:sync -source:appHostConfig="Default Web Site",computerName=https://192.168.0.3:8172/msdeploy.axd,authType=Basic,userName=Publish,password=secret -dest:package=c:\DeployTest\KPC.zip -allowUntrusted
(Updated 2016-03-07 - NOTE: non-Administrator deployments also require ?site=IIS_SITE_NAME
after msdeploy.axd
, otherwise the connection is treated as global and requires Administrator access)
Not sure how missed this originally, but your problem is the computerName
parameter. Non-administrator deployments are only supported when using WMSVC, for which you need to specify the full URL.
Try the following
msdeploy -verb:sync ^
-source:appHostConfig="KitchenPC",computerName=https://192.168.0.3:8172/MsDeploy.axd,userName=kpcpublish,password=secret,authType=Basic ^
-dest:package=c:\DeployTest\KPC.zip
From the docs:
The computer name will be translated to the default Web Deploy URL. For example, computerName=Server1 will become http://Server1/MsDeployAgentService. If the remote service is running with a custom port or URL, you must specify the full URL
And from the install instructions:
The MSI will not install the Web Management Service handler component if the Web Management Service is not installed; the handler component is necessary for non-administrator deployments
(I couldn't find a more explicit canonical source that describes WMSVC as a requirement for non-admin deployments)
After configuring Web Deploy my server as follows. I continued to get HTTP 404 connection failures. In may what worked for me was the following additional efforts...
Microsoft Web Deploy 3.6
publish settings file
using the Configure Web Deploy Publishing
dialogue available from the Deploy
context menu option of the target website in IIS Manager
's Connections
panel. (Note, the publish settings file
will be recreated when you press Setup
as the file whose full path is specified in the dialogue entry, Specify a location to save the publish settings file
) publish settings file
available to Visual Studio and selecting Publish
from your project's context menu, create a Visual Studio publish profile by importing the publish settings file
.Try restarting the wmsvc service on the target machine
As alluded to above, make sure that you are connecting over HTTPS. If you are attempting to connect as Admin, but not using SSL, you get the following error:
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to 'host' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'host'.
(Where 'host' is your server name)
For me the problem was that my password expired... I've noticed it when loging out and then tried to login back trhough remote desktop.