Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed. using IIS7, TFS2010, VS2012

Using Visual Studio 2012, TFS 2010, IIS7

Getting the following errors when I try to build/deploy:

Any CPU | Test
1 error(s), 1 warning(s)

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets      
(4253): Web deployment task failed. (Connected to the remote computer ("server1") using
the Web Management Service, but could not authorize. Make sure that you are using the 
correct user name and password, that the site you are connecting to exists, and that 
the credentials represent a user who has permissions to access the site. Learn more 
at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)

*snip warning*

Other Errors and Warnings
2 error(s), 0 warning(s)
Building the projects in this solution one at a time. To enable parallel build, please 
add the "/m" switch.
TF270015: 'MSBuild.exe' returned an unexpected exit code. Expected '0'; actual '1'.
  • I verified the site exists in IIS
  • I verified I have username and password correct (I'm able to log onto server)
  • User is an admin on tfs server

I don't have VS2012 on my tfs server, but someone copied their C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0 folder to the tfs server to fix another build issue a while back. I copied the same folder to "server1", did not change the error message.

It still creates the build, just does not deploy.

like image 818
scw Avatar asked May 12 '14 15:05

scw


People also ask

How do I know if Msdeploy is installed?

Is Web Deploy installed? You can verify web deploy is installed by going to the "Programs and Features" control panel and looking for "Microsoft Web Deploy 2.0" in the list of installed programs. If it is not there, you can install it via the Web Platform Installer by going to the "Products" tab.

Can't connect to remote server web deploy?

This error indicates that you cannot connect to the server. Make sure the service URL is correct,firewall and network settings on this computer and on the server computer are configured properly,and the appropriate services have been started on the server.

How to check Web Management Service is running?

In the center pane, under Management, double-click Management Service. In the center pane, select Enable remote connections. If the Web Management Service is already running, you'll need to stop it first. In the Actions pane, click Start to start the Web Management Service.


2 Answers

We were able to resolve the issue by the following steps:

  • Highlight the website in IIS Manager
  • In the Features view, open up IIS Manager Permissions
  • Verify that the user you are deploying as has been added. If not, click Allow User and add it.

Hope this helps!

like image 127
meverson Avatar answered Sep 21 '22 06:09

meverson


This can happen if you specify the wrong site name. You have to enter the name as it appears in the IIS Connections, e.g. Default Web Site.

enter image description here

like image 37
OutstandingBill Avatar answered Sep 20 '22 06:09

OutstandingBill