Set-OctopusVariable not being picked up by IISWebSite_BeforePostDeploy

Playing around with Set-OctopusVariable.
I have a variable BlaFoo with value 123.
I use this for a hostheader for my website.

When i try to use: Set-OctopusVariable it gets picked up by web.config, see success.jpg.

But in IISWebSite_BeforePostDeploy, it “has” the original value of 123, so it seems like IISWebSite_BeforePostDeploy, only have “access” to the original variables and not the ones set by Set-OctopusVariable.

I don’t know if this is by design or a bug, but i would guess i would have access to those variables everywhere?

Our use case is to set username and password for app pool to a “ad” account created in PreDeploy.ps1. But doesn’t seem possible with Set-OctopusVariable.

Deploy.ps1 (34 Bytes)

PreDeploy.ps1 (94 Bytes)

Thanks - this is a limitation in how we currently do variable substitution - the substitution happens before either script is run.

If you can locate the full variable name being used in the IISWebSite_BeforePostDeploy script, you may be able to work around this by setting the full variable value, rather than the component being substituted in. E.g. here I think you need to set the full “Octopus.Action.IISWebSite.Bindings” variable.

We’ll see what can be done to improve this and follow up via

Okay, ill try to work around it, would be nice if it just worked everywhere i can see some confusion around where it would work and viceversa, but i might be edgy in what im trying to accomplish.


Trudsø - by phone

On 06/01/2014, at 00.39, “Nicholas Blumhardt” <> wrote: