Insufficient Permissions Problems with MSDeploy and TFS Build 2010

Posted by jdanforth on ASP.net Weblogs See other posts from ASP.net Weblogs or by jdanforth
Published on Thu, 29 Apr 2010 12:24:12 GMT Indexed on 2010/04/29 12:27 UTC
Read the original article Hit count: 2183

Filed under:
|
|

I ran into these problems on a TFS 2010 RC setup where I wanted to deploy a web site as part of the nightly build:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (3481): Web deployment task failed.(An error occurred when reading the IIS Configuration File 'MACHINE/REDIRECTION'. The identity performing the operation was 'NT AUTHORITY\NETWORK SERVICE'.)  An error occurred when reading the IIS Configuration File 'MACHINE/REDIRECTION'. The identity performing the operation was 'NT AUTHORITY\NETWORK SERVICE'. Filename: \\?\C:\Windows\system32\inetsrv\config\redirection.config Error: Cannot read configuration file due to insufficient permissions 

As you can see I’m running the build service as NETWORK SERVICE which is quite usual. The first thing I did then was to give NETWORK SERVICE read access to the whole directory where redirection.config is sitting; C:\Windows\system32\inetsrv\config.

That gave me a new error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (3481): Web deployment task failed. (Attempted to perform an unauthorized operation.)

The reason for this problem was that NETWORK SERVICE didn’t have write permission to the place where I’ve told MSDeploy to put the web site physically on the disk. Once I’d given the NETWORK SERVICE the right permissions, MSDeploy completed as expected!

NOTE! I’ve not had this problem with TFS 2010 RTM, so it might be just a RC issue!

© ASP.net Weblogs or respective owner

Related posts about VS2010

Related posts about tfs