问题
Am am trying to deploy a website via Azure Devops to an IIS server that has the reconfigured "Default Web Site" started with a binding on port 80.
I want my website to run on port 80.
I am using the "IIS Web App Manage" task. When I run my deployment on this machine, I get an error:
[error]Binding (http / * : 80 : ) already exists for a different website ("site "default web site" (id:1,bindings:http/*:80:,state:stopped)"), change the port and retry the operation.
I have stopped the default web site but I still get the same error because the binding already exists.
I have tried using the IIS Web App Manage task to remove the binding on the Default web site but there does not appear to be a way to do this. I do not see another task that will perform this task.
I am trying to automate this for future deployment via Azure Devops so I do not have to change the bindings or remove the default website by hand.
回答1:
I am trying to automate this for future deployment via Azure Devops so I do not have to change the bindings or remove the default website by hand.
Based on my experience, you could add Run PowerShell on Target Machines
task before IIS Web App Manage
task with following script
Get-WebBinding -Port 80 -Name "Default Web Site" | Remove-WebBinding
来源:https://stackoverflow.com/questions/54446426/azure-website-deployment-to-machine-that-already-has-a-default-web-site