Create Application Pool for Virtual Directory

Topics: IIS and Web Services
Aug 9, 2013 at 7:25 PM
Hi Team

I have started using BTDF for my biztalk deployment and i found it quite powerful.

1) I want to use BTDF to deploy virtual Directories along with BizTalk artifacts.Also i want to create application Pool if it is not present.

However, i couldn't find anything which can point me in right direction?

2) I want to have App Pool name dynamic using Settingfile. I tried that, but while deploying the solution, BTDF takes AppPool as String instead of replacing it with value from setting file.

I used following:
<VDirList Include="*">
<PropsFromEnvSettings Include="SsoAppUserGroup;SsoAppAdminGroup;MyAppPool" />

However IIS show "${MyAppPool} as Application Pool for my Virtual Directory.

Please help.

Deepak Sanghi
Aug 13, 2013 at 9:31 AM
If you use a variable name from settings file in VDIRList , it is not replaced by the value while creating Virtual directory. I fixed it in this way. Here I use website id and application pool from settings file:

<Target Name="DeployVirtualDirectory">
<CreateVirtualDirectory MetabasePath="IIS://localhost/w3svc/$(IISWebSiteID)/Root" Name="%(VDirList.Vdir)" Path="$(MSBuildProjectDirectory)\%(VDirList.Physdir)" />
<Target Name="DeployVDirsIIS6Plus" Condition="'$(IisMajorVersion)' != '5'">
<!-- Create app pool and place vdir in app pool for win2003+ -->
  MetabasePath="IIS://localhost/w3svc/$(IISWebSiteID)/Root" VDirName="%(VDirList.Vdir)" AppPoolName="$(MyAppPool)" />
  MetabasePath="IIS://localhost/w3svc/$(IISWebSiteID)/Root" AppPoolName="$(MyAppPool)" UserName="$(VDIR_UserName)" Password="$(VDIR_UserPass)"
  Condition="'$(VDIR_UserPass)' != ''" />
<Message Text="SKIPPING APP POOL IDENTITY CONFIGURATION because the property VDIR_UserPass is empty." Condition="'$(VDIR_UserPass)' == ''" />

<!-- Set the .NET runtime version on the AppPool if AppPoolNetVersion was specified; IIS 7.0+ only -->
<Exec Command="&quot;$(AppCmd)&quot; set apppool /;$(MyAppPool)&quot; /managedRuntimeVersion:&quot;%(VDirList.AppPoolNetVersion)&quot; /managedPipelineMode:Integrated"
      Condition="'$(IisMajorVersion)' != '6' and '$(Configuration)' == 'Server' and '%(VDirList.AppPoolNetVersion)' != ''" />

You also need to add ,
<PropsFromEnvSettings Include="SsoAppUserGroup;SsoAppAdminGroup;IISWebSiteID;MyAppPool" />