Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Adding multiple IIS bindings with Ensure-Site



  • I am deploying IIS websites and am running into trouble with sites that have multiple bindings. How do you specify multiple bindings (ex. http/:80: AND https/:443:) using Ensure-Site? Do you have to use Ensure-Site twice (once for each binding)? If that is the case, are there any plans to allow this from one call of Ensure-Site? I have use cases where servers have 10 IIS sites with 6 bindings each (different host headers). Obviously this is a bit cumbersome if each one is a separate entry.

    Product: BuildMaster
    Version: 5.6.2



  • The operation/configuration doesn't currently support this, though it might not be too difficult to add. Alternatively an additional operation like Ensure-Bindings might work as well.

    Just looking at IisSiteConfiguration.cs, if the BindingInformation property were converted to a string[], you could then specify them in your OtterScript as scalar or vector expression (thus making it backwards compatible), and then alter the configuration's code to verify all of the bindings instead of just the first.



  • I'm also interested in this. Should we just customize the windows extension? What's the process for pushing back into the github repo?



  • Unfortunately we haven't had a chance to do this just yet (it's #11)... but if you'd be willing to try that'd be great! It should be pretty easy to be honest...

    Cloning and Patching an Inedo Extension



  • Writing a custom extension to do this is not really a valid answer. This is broken (as multiple bindings is very common)... and it not working is more than a minor inconvenience.

    It is not ideal, but can work around the problem with appcmd.exe more easily than writing my own extension.

    However, considering this does seem to be an easy change on your side (that would be backward compatible), as you mention, why is it taking so long to address it?



  • Well, the operation was modeled off of other IaC tools (Chef, Puppet, DSC), and they did not seem to support this, so we didn't know if it was needed. But yes, it would be a very nice thing to have, I agree!

    Of course there was only one request for it, and now there are two. We have a fairly large backlog, so it's a matter of prioritizing...



  • This feature will be included in the next maintenance release of Otter (v1.5.3, scheduled this week).

    It will also require an upgrade to the Windows extension (<s>v1.5.0</s> v1.5.1) which will be released at the same time.

    We did want to get this in sooner but it took considerably more effort than initially estimated.



  • Tod/Alana, thank you!

    I look forward to testing it out.



  • Thank you from me too!



  • Alana/Tod, any update?

    Still waiting for the fix... anxiously.



  • The feature was shipped a while ago (Otter v1.5.3 and Windows extension v1.5.1), was there an issue with it?



  • Hmmm... we only use BuildMaster (and Otter script). I am running the latest version with the latest version of the windows extension. It seems to still have problems with multiple bindings (or it is still complaining that there are multiple bindings and it is only going to replace the first).

    Do these changes not get merged into BuildMaster?



  • Just pushed the BuildMaster Windows extension v5.6.3 (for a different reason, but that one should include the multiple binding feature).



  • Looking at the source code in GIT, it doesn't look like multiple hosts is implemented. Maybe I am looking in the wrong place, however, it would be nice to have an official answer and/or an official solution for this problem.



  • The operation is EnsureIisSiteOperation.cs, and it has been implemented.

    Here is how to use it (OtterSCript):

    IIS::Ensure-Site( 
        Name: Otter, 
        AppPool: OtterAppPool, 
        Path: E:\Websites\Otter, 
        Bindings: @( 
            %( 
                IPAddress: 192.0.2.100,  
                Port: 80,  
                HostName: example.com,  
                Protocol: http 
            ) 
        ) 
    );


  • Is there a minimum server requirement for this plugin to work?

    We are running BM version 5.6.3 (Build 3) and recently updated to the latest version of the windows plugin in order to use the multiple binding support. However, it seem not to work leaving us unable to deploy. Also rolling back to the previous version proves to be ineffective.

    When we use the original configuration (pre-multiple bindings) we get the following error:
    Unhandled exception: System.ArgumentNullException: Value cannot be null.

    When we use the new, multiple bindings configuration we get:
    System.Runtime.Serialization.SerializationException: Type 'Inedo.ExecutionEngine.RuntimeValue' in Assembly 'Inedo.ExecutionEngine, Version=50.1.0.0, Culture=neutral, PublicKeyToken=68703f0e52007e75' is not marked as serializable.

    Any ideas?



  • If you upgrade to the latest v5.6 (currently 5.6.11), then it should work OK!



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation