How I can add Bindings in a "IIS web app manage" task using yaml? I tried putting the bindings like classic pipeline and doesnt work
The accepted answer doesn't give a great example on usage. The Bindings
input accepts a multiline string formatted as a particular JSON object. Also be sure to set AddBinding: true
as it appears it will ignore the Bindings
input without it.
On a related note, if you are storing your certificates in WebHosting (as opposed to MY), the deployment will fail as the task won't be able to find your certificate. Here's the relevant github enhancement to fix this
task: IISWebAppManagementOnMachineGroup@0
displayName: 'IIS Web App Manage'
inputs:
IISDeploymentType: 'IISWebsite'
ActionIISWebsite: 'CreateOrUpdateWebsite'
...
AddBinding: true
Bindings: |
{
bindings:[
{
"protocol":"http",
"ipAddress":"*",
"hostname":"mywebsite.com",
"port":"80",
"sslThumbprint":"",
"sniFlag":false
},
{
"protocol":"https",
"ipAddress":"*",
"hostname":"mywebsite.com",
"port":"443",
"sslThumbprint":"...",
"sniFlag":true
}
]
}
You need to create a JSon with all information like this:
{
"bindings":[{
"protocol":"http",
"ipAddress":"*",
"port":"xxxxx",
"sslThumbprint":"",
"sniFlag":false
},
{
"protocol":"http",
"ipAddress":"*",
"hostname":"yyyyyy.com",
"port":"80",
"sslThumbprint":"",
"sniFlag":false
},
{
"protocol":"http",
"ipAddress":"*",
"hostname":"xxxxxxxx.com",
"port":"80",
"sslThumbprint":"",
"sniFlag":false
}
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With