Binding Failure when Using ToLower Filter

I’m trying to use the ToLower filter to change the case of the IIS host name and it it failing miserably.

We use the Variable called HostName for the purpose of the IIS bindings, and whenever I add a filter as per the help files the IIS bindings step fails.

Example (where Environment would be something like “Integration”):
HostName = #{Environment | ToLower}.fewzion.com

However if I remove the filter it works as expected
HostName = #{Environment}.fewzion.com

I then thought, right, what if I change IIS Bindings.Host variable within the Process Step
from “#{HostName}” to “#{HostName | ToLower}”, however it had the same side effect

Interestingly, “#{HostName|ToLower}” (without the spaces) causes a parsing error on the Process Step configuration, and as a result one ends up with a COLLECTION of bindings instead, with all sorts of unusual settings per binding.

If you can’t workout issues I described above, here is a video walkthrough as well:

Cheers, Alex

Hi Alex,

Thanks for getting in touch! Sorry about the trouble this is causing.
Our bindings uses pipes to separate multiples and this is breaking even when the variable is bound as you have found.
I have created an issue in GitHub which you can track here: https://github.com/OctopusDeploy/Issues/issues/1193

Vanessa

Hi Venessa,

Thanks for the prompt response, and for logging the issue on Github.

Out of interest, is there a workaround for setting the hostname variable based on the lower case value of another variable as per my original requirement? was I doing anything wrong in my configuration?

Cheers, Alex

Hi Alex,

Unfortunately the only work around would be to create a powershell step ahead of where you need it, create the variable using toLower there and then reference it back in the following step.
It’s very non-elegant and heavy handed unfortunately.

Your configuration was fine, and would have worked for anything other than within the IIS binding fields.
Vanessa

We’ve just hit the similar issue on 2.6.0. I’ve updated git issue (https://github.com/OctopusDeploy/Issues/issues/1193).

Hi Dmitry,

Sorry for the delay, I needed to find time to test this. I’ve updated the ticket, I can replicate the issue, so reopened.

Vanessa

Hi Vanessa,

Do you know if this issue is still there in OD 3?

Cheers, Alex

Hi Alex,

Damo confirmed in the GitHub ticket that it was resolved in 3.0.

Hope that helps.
Vanessa

Hi Vanessa,

It does, thank you :slight_smile:

Do you think that we should close this post then?

Cheers, Alex

Hi Alex,

That would be great. We never close tickets but let the OP (in this case you) determine when it needs to be closed. When we close even you (as the OP) can’t respond if you need to, but if you close it you can reopen it later if required.

Vanessa

Cool, case closed :slight_smile: