Why is Web Deploy saying Administrator is not an admin? - webdeploy

I have a Server 2012 R2 machine on a domain to which I would like to use Web Deploy to deploy a web site. This works fine when I use my domain credentials.
Web Deploy fails with ERROR_USER_NOT_ADMIN when I use either the Administrator account, or a new account in the Administrators group.
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to '192.168.76.109' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on '192.168.76.109'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
I have tried using the special MSDepSvcUsers group, installing all sorts of remote management tools for IIS 8.5, delegating permissions, and reinstalling Web Deploy after installing the remote management features. Because I am a vegetarian, I have not yet tried sacrificing a goat.
Why can't I use a local account to deploy my web site?

Related

Running Selenium Tests from a VSTS Hosted Agent

I am running the Selenium test in Visual Studio Team Services with VS2017 hosted agents, but I think I am having issue's with company's proxy.
I am running the Selenium test from Visual Studio 2015, it runs very fine and able to access the web application.
When I am running the same Selenium test in VSTS using hosted agents, then it is failing on the below error and not able to reach the URL of the application to be tested:
"The site can't be reached"
I know there are proxy authentication required in my company but I am not sure how to run the Selenium test from VSTS hosted agent which can bypass the proxy.
If someone know the answer, please respond
The hosted agent is run by Microsoft and exists in Azure. It does not have connectivity to your internal network where your site is hosted.
You will need to set up a private agent that exists within your local network. A proxy can be configured for a private agent during setup with the following command line: ./config.cmd --proxyurl http://127.0.0.1:8888 --proxyusername "1" --proxypassword "1"
Ref: https://learn.microsoft.com/en-us/vsts/pipelines/agents/proxy?view=vsts&tabs=windows
We have several groups of agents hosted internally that can access stuff hosted on premise. We configured the agents using PAT's by clicking on user profile > security and generating a new PAT.

Using Web Deploy with Visual Studio and Plesk

I am trying to web deploy a Asp.Net Core 2 project through plesk.
My plesk version is;
Plesk Onyx
Version 17.8.11 Update #6
IIS 8.5.9600
I have also followed the guide and added web deploy to the server;
Plesk Web Deploy Guide
However, when I go to publish my website i get the following error;
Web deployment task failed. (Connected to 'www.domain.co.uk' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'www.domain.co.uk'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.)
Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
Error details:
Connected to 'domain' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'www.domain.co.uk'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
The remote server returned an error: (401) Unauthorized.
Now I have tried the admin login for the plesk portal and I still get this message?
How and where do I add user privileges (just for this site) to allow the web deploy to work?
UPDATE
I have gone to subscriptions -> selected the subscription -> users, create a new user for this and then added a new administrator user her. But again when I try to run the web deploy through visual studio I am getting the same error (the user is definitely in the admin role).

One-Click Web Deploy failing: "This method is not supported by this class."

I've found a lot of articles on web deploy and why it might fail, but not any with answers with this error message.
Web deployment task failed. (Could not complete the request to remote agent URL https://myserver:8172/msdeploy.axd?site=mysite.)
Could not complete the request to remote agent URL https://myserver:8172/msdeploy.axd?site=mysitename. The request was aborted: The request was canceled. This method is not supported by this class.
I am trying to deploy an MVC4 website from Visual Studio 2013 Express to a Windows 2008 R2 Datacenter server with the Web Server role installed.
I followed this (and other installation guides) and can confirm the following:
Windows Server 2008 R2 Datacenter
Web Server role installed
Management Services is running
Accepting windows and IIS credentials
Server Administrator has permissions
Remote connections enabled (and service restarted)
SSL certificate is our real one, not the self-cert
My firewall is configured to allow this traffic
I am prompted for a username/password when accessing https://myserver:8172/msdeploy.axd
The website is running
Bound to all IPs on :80 and :443 (with same cert as deploy)
So for some reason, it didn't want the Windows Administrator account doing a deploy.
Created an IIS user in IIS Manager User
Changed the permission settings to Windows credentials or IIS manager credentials
Restarted Management Service
Added the newly created user to the website
it works!

Web Deploy results in ERROR_COULD_NOT_CONNECT_TO_REMOTESVC

We are trying to configure continuous integration with TFS 2012. While queuing a new build, the publish fails with the error:
Build FAILED.
"C:\src\ProjectName.sln" (default target) (1) ->
"C:\src\Website\ProjectName.csproj" (default target) (2) ->
(MSDeployPublish target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4377,5): msdeploy error ERROR_COULD_NOT_CONNECT_TO_REMOTESVC: Web deployment task failed. (Could not connect to the remote computer ("ServerName") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC)**
I checked all the points mentioned in the IIS.NET documentation for this error. Both services mentioned, Web Management Service and Web Deployment Agent Service, are running fine. A restart of those services has no change in behavior.
Windows Server 2008 R2 with IIS 7.
Web Deployment Agent Service is running on port 8172.
Web Deploy 3.0
Windows Firewall is not blocking any port on the server.
How can this be fixed?
If you install Web Deploy 3.x BEFORE Web Management Tools are installed, you'll have to re-install Web Deploy. I beat my head against the wall for hours on this.
Install the Web Management Services ("Turn Windows Features On/Off"/Roles -> Web Server -> Management Tools -> Management Service)
Then uninstall Web Deploy (repair didn't work) via the usual Add/Remove Programs control panel
Install Web Deploy 3.x again using Web Platform Installer.
Fixed. /Sigh
Double check in your Web Deploy settings that the name of the website is exactly that of what's in IIS.
Ben Day blogged more about it.
Fix that i saw on another website:
Fix it by adding “http://” to server.
In other words, when server is www.xxxx.com would get the 403 error, but when server is http://www.xxxx.com, then it works.
You need also to indicate the app name e.g 'Default Web Site/MyApp'
That was my error. Once I added /MyApp, it worked.
I got this error when using msdeploy, not TFS. In my case I needed to make sure the user msdeploy is using had permission to deploy to the website.
Find the website in IIS manager, right click and go to Deploy, then Configure Web Deploy Publishing. Find the user used by Web Deploy and setup for this website.
In my case the Internet proxy was enabled on source - which made msdeploy to reach out to internet instead of local ICN.
You should check the logs on your IIS first - see that you actually get to the server, and then you can locate the exact error here - https://support.microsoft.com/en-us/help/943891/the-http-status-code-in-iis-7-0-iis-7-5-and-iis-8-0
Uninstalling and re-installing (not repairing!) after setting up IIS did most of the magic for me.
There is another possible cause of the error. IIS Managemente Service have its own configuration for IP Address Restrictions, which default value is Deny Access for unspecified clients (Windows Server 2012 R2 with IIS 8.5).
You must set this value to Allow or add access to your specific IP address/IP address range using the Allow... button.
Remember, you must Stop the Management Service previously to change this configuration.

WebDeploy gets Unauthorized error while deploying via remote Web Deployment Agent

I have a remote server (Win2008R2) with WebDeploy 3.0 installed on it. Web Management Service isn't installed on it (actually I tried to install it but it cannot be contacted due to closed ports on my side).
I'm trying to deploy a package (zip) to the server via local WebDeploy 3.0 tool.
Server.deploy.cmd /T /M:myserver.no-ip.org "/U:myserver\Administrator" "/P:pwd" /A:Basic
I tried both Basic and NTLM auth methods.
I'm getting error:
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to 'myserver.no-ip.org' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'myserver.no-ip.org'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.
Please note that I'm actually connectin to WebDeploy Agent Service not Web Management Service. That's important as there are tons of info how to setup WMSrc with WebDeploy.
I know that WebDeploy Agent only supports connecting as Administrator. That is my case - I'm specifying the remote server Administrator credentials.
I tried to open WDAgentSrc url in the browser. I was promted for creditials and they were accepted.
I checked "Microsoft Web Deploy" log in the Event viewer - it's empty.
How to get it working?