I’m trying to create an IIS deployment step, where Application pool name is generated as a combination of a constant string and #{Octopus.Release.CurrentForEnvironment.Name} variable data.
While it works for ‘Web Site name’ field, it fails for ‘Application Pool name’. Looks like variable substitution does not work for this property.
Octopus version is 3.16.3
Tentacle version is 3.15.6
Log output:
Application pool “#{Octopus.Release.CurrentForEnvironment.Name}.tolerance.api.local” does not exist, creating…
SemaphoreInstance Global\Octopus-IIS-Metabase released
New-Item : Invalid application pool name
At E:\Octopus\Applications\Test\Seek4Cars.API.Tolerance.Service\1.0.22.1_3\Octo
pus.Features.IISWebSite_BeforePostDeploy.ps1:195 char:4
-
New-Item $appPoolPath -confirm:$false
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
CategoryInfo : InvalidData: ( [New-Item], COMException
-
FullyQualifiedErrorId : Invalid application pool name
,Microsoft.PowerShell.Commands.NewItemCommand
Deleting ‘E:\Octopus\Applications\Test\Seek4Cars.API.Tolerance.Service\1.0.22.1_3\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’
Script ‘E:\Octopus\Applications\Test\Seek4Cars.API.Tolerance.Service\1.0.22.1_3\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1
Running rollback conventions…
Adding journal entry:
Script ‘E:\Octopus\Applications\Test\Seek4Cars.API.Tolerance.Service\1.0.22.1_3\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1
Updating manifest with output variables
Updating manifest with action evaluated variables
Planning retention policy
The remote script failed with exit code 1
at Octopus.Worker.Scripting.ScriptResult.EnsureSuccessful()
at Octopus.Server.Orchestration.Deploy.Package.PackageActionHandler.Execute(ActionCommand command, Machine machine)
at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.<>c__DisplayClass29_0.b__0()
at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteWithTransientErrorDetection(Action action, Machine machine)
at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteActionAndInitLoggingContext(PlannedStep step, Machine machine, PlannedAction action)
Deploy IIS on Localhost