简体   繁体   中英

Web Deploy 3.6 on ws2012r2 host, deploy from VS 2015 fails with 401 error

This is with Web Deploy 3.6, with properly configured remote management services configured and running on a Windows Server 2012 R2 box, and Visual Studio 2015 on a developer PC using Windows 10, and deploying from Web Deploy invoked from within the IDE. (Update: It appears http is the problem, Web Deploy just doesn't work with http.)

This is a little different than the other questions about Web Deploy failing with 401 errors, in that the error only happens during the real deploy and not during the "validate connection".

All the solutions posted for the other two similar questions were tried. There is a registry hack (UAC issue) and a few other things. There are local filesystem permissions to be checked.

There must be some NEW bit of trickery required for IIS on Windows Server 2012 R2, with Web Deploy 3.6, to get this "wonderful" technology to consent to work.

It's 2016, and Web Deploy is as infuriating as ever.

网络部署你没有工作?

Web Deploy 3.6 and prior versions seem to have hundreds of major wrinkles, many coming down to having undocumented requirements like https being basically required, and the various bits like msdeploy having hideously complex command line syntax.

I tried Web Deploy from inside Visual Studio, and it worked against a production system on Azure, but was failing on my in house dev systems.

It seems to be usable on systems with valid signed certificates from inside visual studio IDE, and if you want to deploy to a developer IIS box, be sure the system is listening on https. If you use a self-signed certificate, you may need to use this workaround, which lets you deploy from your CI system or your developer command line:

  1. Add https binding to your development or deployment server's site's bindings.

  2. Only push through https with webdeploy, it tends to fail when you use http.

  3. If you do not have a valid trusted certificate (such as a self signed cert), you can add -allowUntrusted to the command below.

  4. Find the msdeploy command syntax as it is printed in the Visual Studio IDE's output panel, it will be something like this, then modify it.

Please don't store credentials in plain text. I am using a batch file in my CI systems and my secrets are stored in the CI system, and injected into the batch file using %ENVIRONMENT_VARIABLE% syntax.

-

  "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" 
  -source:manifest='C:\Users\...\SourceManifest.xml' 
  -dest:manifest='C:\Users\...\DestinationManifest.xml',
  ComputerName='https://192.168.215.141:8172/msdeploy.axd
  ?site=something',UserName='something',
  Password='something',IncludeAcls='False',AuthType='Basic' 
  -verb:sync -enablerule:AppOffline -enableRule:DoNotDeleteRule 
  -retryAttempts:20 -allowUntrusted

From the command line (or a batch file of your own), something like the above is working for me, even when it STILL fails inside the visual studio IDE. The question remains open in case there is a way to get Web Deploy to actually function inside Visual Studio IDE.

I have now tested this with a trial Windows Server 2016 vm, and with Windows server 2012 r2, and in my opinion web deploy 3.6 is just broken, and no part of it appears more broken than the wizard/visual publish part of visual studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM