CodeWarrior
CodeWarrior

Reputation: 7470

TFS 2012 Team Build and Web Application Deployment - ERROR_USER_NOT_ADMIN

We have a solution consisting of several class libraries, and a Web Application Project. We are using TFS 2012 with Team Build. The solution compiles correctly on the build server.

I am currently trying to do this via MSBuild Arguments.

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=https://testWebServer:8172/MsDeploy.axd?site=direct /p:AllowUntrustedCertificate=True /p:DeployIisAppPath="direct" /p:AuthType=NTLM

The solution builds but does not deploy. I get the following error message:

msdeploy error ERROR_DESTINATION_INVALID: Web deployment task failed. ( Could not connect to the remote computer ("https"). Make sure that the remote computer name is correct and that you are able to connect to that computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_INVALID.) [C:\Builds\1\ProjectName\Solution General Build\Sources\Temp Source\ProjectName\Solution\Project.csproj]

Is there another argument I should be passing to specify the server? I did not intend for https to be the server name... I have tried omitting the https:// to no avail, error is the same, so it is getting the value from somewhere.

I have tried this with the following values for MsDeployServiceUrl:

Update

Alright, the following is at least connecting:

I have seen numerous posts concerning that particular argument, and almost invariably they are a URL, not just a hostname (the ones that appear to be a hostname I thought were just written that way for brevity).

I am now, however, faced with a new problem. I have made the Build Service Account (domain account) local admin on the webserver, and I am getting msdeploy error ERROR_USER_NOT_ADMIN as well as an Audit failure in the Security log.

Resolution

These are the MSBuild arguments I am currently going with.
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=WMSvc /p:MsDeployServiceUrl="https://SERVER:8172/MsDeploy.axd" /p:AllowUntrustedCertificate=True /p:DeployIisAppPath="siteName"

I am now getting ERROR_USER_UNAUTHORIZED. Apparently I have either not set up the delegation correctly or the IIS Manager User I have created is somehow incorrect. Regardless that will go in a different post if necessary.

Upvotes: 3

Views: 5770

Answers (2)

Alex Ayscough
Alex Ayscough

Reputation: 111

I had a similar issue. To resolve the issue I tried the following steps:

  1. As it was a hosted server we had to make sure that the port 8172 was open (obviously).
  2. Creating a new login and set this up in IIS -> Deploy -> Configure -> Configure Web Deploy Publishing on the target server. I made sure that the password didn't have any spaces in to avoid the quotes issue just to be sure.
  3. Actually running a manual deployment from the build server.
  4. Finally specifying an IP address in the MSDeployServicerl: /p:MsDeployServiceUrl=xxx.xxx.xxx.xxx:8172/msdeploy.axd

None of the web site names worked for me either. None of my parameters had quotes in. Of course if you leave a space in incorrectly in one of your parameters you will get the error: MSBUILD : error MSB1008: Only one project can be specified

Upvotes: 1

Isantipov
Isantipov

Reputation: 20909

What is the Server and IIS version, you are using? IIS 6 uses Web Deployment Agent Service (MsDepSvc), whereas IIS 7 usually uses Web Management Service (WMSvc) which have different URLs (besides, you have to be an admin on the target server to execute MsDepSvc.

Can you try specifying

/P:MSDeployPublishMethod=WMSvc

Based on this article from Troy Hunt, Web Management Service (WMSvc) is using

.axd 

URLs (the one you specify), whereas you are trying to force it use RemoteAgent publish method which seems to be inconsistent.

See this article for complete set of differencies between WMSvc and RemoteAgent publish methods.

Upvotes: 3

Related Questions