Skip to content

Commit 3cf6efc

Browse files
committed
fix: use appcmd set app for AppPool assignment
The site collection indexer syntax [path='/'].applicationPool gets mangled by appcmd. Use 'set app SiteName/' instead which is the canonical way to assign AppPools to site root applications.
1 parent be09bf5 commit 3cf6efc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cloudformation/scenarios/localgov-ims/docker/iis-config.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ foreach ($site in $sites) {
4747
& $appcmd add site /name:$($site.Name) /physicalPath:$($site.Path) /bindings:"http/*:$($site.Port):"
4848
if ($LASTEXITCODE -ne 0) { Write-Error "Failed to create site $($site.Name)"; exit 1 }
4949

50-
# Assign AppPool
51-
& $appcmd set site /site.name:$($site.Name) /[path='/'].applicationPool:$($site.Pool)
50+
# Assign AppPool -- use app command instead of site collection indexer
51+
& $appcmd set app "$($site.Name)/" /applicationPool:$($site.Pool)
5252
if ($LASTEXITCODE -ne 0) { Write-Error "Failed to assign AppPool for $($site.Name)"; exit 1 }
5353
}
5454

0 commit comments

Comments
 (0)