Web Deploy 4.0 ERROR_USER_UNAUTHORIZED

deskcheck1-0579 411 Reputation points
2024-05-03T18:19:18.4666667+00:00

We are hosting our website on our own server running Windows Server 2022. I have installed an SSL certificate from a Certification Authority on the server.

I created a local user account with credentials that I can use to deploy the website to the server from my development machine.

I'm using C#, VS 2022 Professional and my target framework is MS .NET Framework 4.8. I have the same versions of Web Deploy on both development machine and production server. I have Desktop Runtime 8.0.4 (x64) installed on the production server.

When I try to deploy the website, I get ERROR_USER_UNAUTHORIZED. What more settings do I need to do to deploy my website? Am I missing something?

Appreciate any help.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. deskcheck1-0579 411 Reputation points
    2024-05-03T20:01:02.95+00:00
    0 comments No comments

  2. Grmacjon-MSFT 19,151 Reputation points Moderator
    2024-05-07T04:20:58.07+00:00

    Hi @deskcheck1-0579 I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:

    • You’re hosting your website on a server running Windows Server 2022 and have installed an SSL certificate from a Certification Authority. You’ve created a local user account with credentials for deploying the website from your development machine to the server.
    • You’re using C#, Visual Studio 2022 Professional, and targeting MS .NET Framework 4.8, with the same versions of Web Deploy on both machines and Desktop Runtime 8.0.4 (x64) on the server.
    • However, you’re encountering an ERROR_USER_UNAUTHORIZED when trying to deploy the website and are unsure of the additional settings required for successful deployment.

    Solution:

    This Azure doc " Configure the Web Deployment Handler" helped you resolved your issue.

    The doc shares how to deal with common issues that can occur during deployments: like receiving 401 unauthorized error while trying to connect to a Web site.

    • Cause(s): This error comes from WMSVC and is usually an error with username/password, or because the user does not have access to the website.
    • Resolution(s): Verify the username/password and that the user has access to the website.

    Thanks again for sharing what worked for you.

    Best,

    Grace


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.