How to do Skip Directives using default provider in Web Farm Framework 2.0 (WFF 2.0) by changing the applicationHost Config?

One of the feedback that customers provided was to enable them to exclude a specific set of directories from provisioning. WFF 2.0 enables this feature and lets customer control the provisioning of the directories using its default sync provider. Default behavior is to provision all the files and directories from the primary server to the secondary servers. Also note that the ACLs for the files and directories will be intact after the sync. Let’s assume that you have Folder1 and Folder2 under Default Web Site and you want to sync only Folder2 and exclude Folder1. In order to exclude the directories follow the steps below. 

1.       On the controller machine open the applicationHost.config file. This is under the directory %windir%\System32\inetsrv\config

2.       Under applicationProvision element you need to add an entry to skip the directives as follows.   
<webFarms> 
    <webFarm serverAutoStart="false" name="Farm" enabled="true" adminUserName="{0}\administrator" adminPassword=”pwd”  primaryServer="demo-primary"> 
    <server address="demo-primary" enabled="true" />           
    <server address="demo-secondary" enabled="true" />
           
    <platformProvision syncPlatformFromPrimary="true" />
           
    <applicationProvision syncWebServerFromPrimary="true">
                
    <skipDirectives>
                   
        <skip name="folder1" skipDirective="objectName=dirPath,absolutePath=.*folder1.*" />
               
    </skipDirectives>           
    </applicationProvision>
       
    </webFarm>
    
</webFarms>
3.      When we save the changes WFF immediately picks up the changes from the configuration file and do application provision.4.       Verify that secondary servers provisioned only with Folder2 and Folder1 was excluded.5.       You can also Skip binding as follows<skip name="folder1" skipDirective="attributes.protocol=https" />6.       One another way you can do the syncing of a particular directory using msdeploy command directly as follows for each secondary server.C:\>cmd.exe /c ""%ProgramFiles%\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:contentPath="Default Web Site",computerName=demo-primary -dest:contentPath="Default Web Site" -skip:objectName=dirPath,absolutePath=.*folder1.*"  

 

3 Comments

  • Can you provide more specific details on this line: skip name="folder1" skipDirective="objectName=dirPath,absolutePath=.*folder1.*" Specifically I'm wondering about absolutePath=.*folder1.* Does that imply ANY folder named folder1 in this application will not be provisioned? For example, what if I had a folder structure like root/2009/folder1 and root/2010/folder1. Would both of those folder1 directories be excluded? Can you provide a few examples of how this absolutePath value would appear in various situations? Thanks!

  • Do you know of any other tags like the skipDirectives that can be usd in the applicationHost file? Like maybe one for 'includeAcls=true'? I want my permissions to synch also - there are other ways of doing this, just was hoping to find cleaner way.

  • NOTE - We had trouble with making the Skip Directive skip a child folder. We finally found the answer in O'Reilly's "Mastering Regular Expressions" (what?! you weren't using that book?). You need to use "^.*\\" after the 'absolutePath=' statement. E.G. - "absolutePath=^.*\\catalog.wci""

Comments have been disabled for this content.