Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k views
in Technique[技术] by (71.8m points)

azure devops - Deploying web packages with MSDEPLOY

I've built my packages and read through this docs @ http://www.asp.net/web-forms/overview/deployment/web-deployment-in-the-enterprise/deploying-web-packages

And it seems to suggest that the problem should be relatively simple from here as the instructions clearly show ...

[project name].deploy.cmd [/T | /Y]
                          [/M:<computer name>]
                          [/A:<Basic | NTLM>]
                          [/U:<user name>]
                          [/P:<password>]
                          [/L]
                          [/G:<true | false>]
                          [Additional MSDeploy.exe flags]

.. so, no problem I thought I will give the command params like this ...

myproj.deploy.cmd /Y /M:test.foo.com /A:basic /U:<my user> /P:<my pass>

... where the user and pass are an admin account on my server.

For some reason though this results in a 401 ...

Error code: EEROR_USER_NOT_ADMIN
More Information: Connected to 'server' using the Web Deployment Agent Service but could not authorize. Make sure you are an administrator on 'server'

... well, I used my admin credentials, the same ones I used with VS for the one click deploy and they worked in VS so how come they aren't working on the command line when pushing the package?

...

EDIT:

I looked through the logs, checked out the ms deploy command it was generating and decided to skip the cmd file altogether and go straight to ms deploy myself.

I found the command it was generating and cleaned it up to something like this ...

msdeploy.exe
  -source:package='..package.zip' 
  -dest:auto,computerName=test.foo.com,userName=<me>,password=<my pass>,authtype=basic,includeAcls=False 
  -verb:sync 
  -disableLink:AppPoolExtension 
  -disableLink:ContentExtension 
  -disableLink:CertificateExtension 

Apparently my account when used in this context is not an admin (a total lie or perhaps I missed something).

here's what technet has to say on it: https://technet.microsoft.com/en-gb/library/dd569106(v=ws.10).aspx

which links to this: https://technet.microsoft.com/en-gb/library/dd569001(v=ws.10).aspx

which states ...

The Web Deployment Tool does not perform local impersonation. If you provide values for the username and password provider settings but do not specify the name of a remote computer for the computerName setting, the credentials that you provide will have no effect.

does this mean because I am specifying a domain name and not a machine name the credentials I am specifying have been ignored?

If so ... how am I supposed to do this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Apprently undocumented anyway ... the answer is ...

You can't run MS deploy commands that talk to the MSDeploy service on the same machine.

No idea why, this makes no sense, but taking the same command and executing it on another box seems to work fine even when deploying to the same box I had the issue on.

Well done Microsoft ... way to make a Team Services Admins life a dream!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...