5
votes

I successfully configured IIS for Web Deploy and added a IIS Manager User. The problem is when i try to publish, i get back error

Error 1 Web deployment task failed. (Unable to perform the operation ("Delete Directory") for the specified directory ("2_0_50727"). This can occur if the server administrator has not authorized this operation for the user credentials you are using. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER.) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets 4270 5 WebAPI

Which shortly means, there are no premissions for user to handle root folder content. I couldn't figure out, who is the user, to give the permissions to.

The linked Microsoft page is telling, in most of the case, it's "Local Service", well it already has full control permissions. So i tried more "IUSR", "DefaultAppPool" - still not right ones. The temporary solution is to give permissions to "Everyone" and then it works... but who's the right user??

2
Have you looked at this? blogs.iis.net/krolson/… There's a section with the title "How to find out what account to add for IIS user ACLs"Pablo Romeo
Did you build out IIS with the proper structure yet? Never use the defaultapppool, as that is a poor practice. You need a new site in IIS, a folder for the site to be published too, and a new IIS pool for the site to be hosted in.TGarrett

2 Answers

3
votes

Did you add a rule (contentPath, createApp, dirPath, filePath, iisApp, runCommand) for your IIS Manager user in Manager Service Delegation?

And also I granted access to the site folder for LOCAL SERVICE because Web Management Service runs under this account and for NETWORK SERVICE because of Web Deployment Agent Service.

2
votes

Right click the web site in IIS Manager and choose Deploy -> Configure Web Deploy Publishing. Choose your IIS-user and Setup, in order to give correct rights for publishing to that site.