Set write permission to folders during webdeploy

08 Apr 2017

Microsoft webdeploy helps developers by simplifying the deployment of ASP.Net websites. It can

  • Package the required files for the deployment
  • Package an entire website along with the database, permission settings, registry settings etc., for migration
  • Easily package and deploy the package to multiple servers/farms
  • identifies missing dependencies & synchronize just the changed data
  • can perform backup of existing code/application before deployment

By default, web deploy assigns readonly permission for the files and folders during deployment. but we can tailor this behaviour to set the 'WRITE' access for specific folders.

Before deployment, web deploy creates a ACL list of folder. So inorder to add our required permission, create following file in your project root


Replace 'solutionname' in above filename with your solution name and it will be automatically picked up by the webdeploy tool before deployment.

Following sample wpp targets file, instructs the webdeploy tool to set read,write permission to folder that matches path "/content$"

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="">

  <Target Name="SetupCustomAcls" AfterTargets="AddIisSettingAndFileContentsToSourceManifest">   
      <MsDeploySourceManifest Include="setAcl">

  <Target Name="DeclareCustomParameters" AfterTargets="AddIisAndContentDeclareParametersItems">
      <MsDeployDeclareParameters Include="ArticleGallerySetAclParam">
        <Description>Add write permission to content folder.</Description>