Deploy a IIS Website without bindings


When deploying a IIS web site, one may want to not alter existing bindings (for various reasons).
I first tried to achieve that by removing all bindings from the “IIS Bindings” section but that give me a rather obscure error :

14:28:40 Info | Making sure a Website “MyWonderfulButYetNotOptimumWebSite” is configured in IIS…
14:28:40 Error | foreach-object : You cannot call a method on a null-valued expression.
14:28:40 Error | At C:\Octopus\Applications\Integration\MyWonderfulButYetNotOptimumWebSite\1.0.1
14:28:40 Error | \Octopus.Features.IISWebSite_BeforePostDeploy.ps1:453 char:31
14:28:40 Error | + $bindingString.Split("|") | foreach-object {
14:28:40 Error | + ~~~~~~~~~~~~~~~~
14:28:40 Error | + CategoryInfo : InvalidOperation: (:slight_smile: [ForEach-Object], RuntimeE
14:28:40 Error | xception
14:28:40 Error | + FullyQualifiedErrorId : InvokeMethodOnNull,Microsoft.PowerShell.Commands
14:28:40 Error | .ForEachObjectCommand

Then I tried to set a unique binding but disabled it. That works but removed all binding from by Website.
Is there any way I can tell Octopus to not alter binding for my website ?


Hi Bertrand,

Thanks for getting in touch. That error is because we expect and require there to be at least 1 binding, in version 3.16.3 it’s patched so you can’t save the project without a binding to avoid that deployment time error, here’s the issue if you’re curious:

So unfortunately the answer is no, there has to be at least 1 binding.

The bindings specified in the deployment step will be the the ones that end up on the web site, it will delete any others and make it all match what’s defined in your step see here if curious.

As for a work around it gets complicated, if you don’t want to supply bindings then you may want to consider setting up and deploying it as a web application instead, but then you may need use URL rewrite if the URL change isn’t desired.


There’s a uservoice regarding this, that you might want to vote for.

You can work around this shortcoming by using community step templates to backup and restore your existing bindings.


So to let Octopus manage IIS applications physical path I absolutely must let it manage IIS bindings. :confused:

That’s not really convinient, especially when you’re catching up with an old architecture (I need to catch up bindings on something like 5 or 6 IIS apps accross 5 environments) : you need to update the whole system for all environments at once :o

Anyway, we’re going with the “let it manage everything” which was the final goal, but I wish I could do it the gentle way. That’s a lot to configure and test at once ! :o


1 Like