Samuel Goldenbaum
Samuel Goldenbaum

Reputation: 18909

Webdeploy Issues: Cannot deploy unless admin

I am trying to deploy a site using msdeploy and cannot get it to deploy under an IIS user account. My admin account is able to deploy successfully.

Steps I have taken:

  1. Created IIS user account
  2. Give the account access to the relevant website
  3. Setup deployment for the site granting the iis user account permissions to deploy
  4. Ensured that the WMSVC has full rights to the physical folder
  5. Add the IIS user account to the relevant rule in Management Service Delegation

I get the following error back:

Unable to perform the operation. Please contact your server administrator to check authorization and delegation settings.

Upvotes: 25

Views: 8836

Answers (3)

Sha
Sha

Reputation: 2397

As other's have mentioned, it is usually a problem with an expired password for the WDeployConfigWriter user in Windows Server.

What I usually do when resetting the password and configuring password never expires is not enough:

  1. For Server 2016, Go to Programs and Features

    • Select Uninstall for Web Deploy 3.6
    • Now select Repair.

    For Windows Server 2022, go to Programs and Features

    • Select Microsoft Web Deploy 4.0
    • Now select Repair.
  2. Go to IIS Manager. Then reconfigure Web Deploy for your IIS site: You can change the old Web Deploy user´s password or delete that user and create a new user.

  3. Next, go to Start | Administrative tools | Computer Management.

  4. Then go to Local Users and Groups - check password never expires on the user WDeployConfigWriter

  5. You may need to restart IIS completely, after repairing the Microsoft Web Deploy 3.6/4.0.

That usually solves my problem. In Windows Server 2022 I sometimes have having problems deploying .NET 4.8 projects, while .NET (core) 5.0-7.0 will publish.

The Visual Studio failure messages are not very helpful:

1)

An error occurred when the request was processed on the remote computer. The server experienced an issue processing the request. Contact the server administrator for more information

2)

Please contact your server administrator to check authorization and delegation settings

When the 4.8 projects fail, I usually follow 5 steps above, and then restart IIS. Sometimes it works, sometimes it does not.

For times where it does not work, I simply 'Web Deploy' using a built-in Windows Administrator account; in your deployment settings use an account that belongs to the Administrators group and then do the deploy. If you use a built-in IIS Manager account to authenticate, sometimes rights are not propagated properly on the Windows folders structure, which will yield the above errors. You can set permissions manually on the folders, but that can be a pain too getting it right.

Upvotes: 6

Hiren Parghi
Hiren Parghi

Reputation: 1895

Following changes fixed my issue.

Start >> Administrative tools >> Computer Mangement. 

There is a user called WDeployConfigWriter. Set to password never expired and updated in IIS as per the below link.

https://blog.workinghardinit.work/2011/07/18/wdeployconfigwriter-account-issues-trouble-shooting-web-deploy-2-0-with-lessons-learned/

Upvotes: 32

Samuel Goldenbaum
Samuel Goldenbaum

Reputation: 18909

Turns out it was an expired password for the WDeployConfigWriter account.

Upvotes: 52

Related Questions