Adding a binding to a nested web application

I have a web application that lives under my deployed website. On the website deploy I can configure the valid bindings but I can’t do that with the web application deployment.

Is there a custom step template I can use to add the net.pipe binding to my sub application?

Hi,

Thanks for reaching out If you are talking about this kind of binding, then I’m afraid we still don’t have support for it and you’re gonna have to Powershell your way around it

Feel free to add it as a Uservoice suggestion please. If enough users get behind the idea, we might implement it in the future.

http://octopusdeploy.uservoice.com/

Thanks,
Dalmiro

Ok thanks,

You don’t have an example powershell script by chance?

As for voting, I put my support behind

Which is basically the same thing except for TCP

Robson

Hi Robson,

I’m sorry, don’t have any example at hand :(.

That’s actually the perfect Uservoice to add your votes to. Good find!

Regards,
Dalmiro

In case anyone else ever needs this…

The following power shell seems to work:

Import-Module WebAdministration
$websites = Get-ChildItem 'IIS:\Sites'
$site = $websites | Where-object { $_.Name -eq 'Default Web Site' }
$netPipeExists = [bool]($site.bindings.Collection | ? { $_.bindingInformation -eq '*' -and $_.protocol -eq 'net.pipe' })
if (!$netPipeExists )
{
    Write-Output "Net Pipe binding does not exist. Creating binding now..."
    # Create the binding
    New-ItemProperty 'IIS:\Sites\Default Web Site' -name bindings -Value @{protocol="net.pipe";bindingInformation="*"}
    Write-Output "Binding created"
}
else
{
    Write-Output "Net.pipe Binding already exists"
}
Write-Output "Updating enabled protocols..."
Set-ItemProperty 'IIS:\sites\Default Web Site\MyNestedVirtualApplication' -name EnabledProtocols -Value "http,net.pipe"
Write-Output "Enabled protocols updated"

Thanks for sharing that! I mentioned your script in a comment on the Uservoice suggestion.

For setting the Enabled Protocols I can say from experience it works with the
IIS Website - Update Property Step Template.

:wink:

Setting Enabled Protocols

Regards

Emiel