我正在尝试通过 Azure Devops 将网站部署到 IIS 服务器,该服务器的“默认网站”以端口 80 上的绑定(bind)开始。
我希望我的网站在端口 80 上运行。
我正在使用“IIS Web App 管理”任务。当我在这台机器上运行我的部署时,我收到一个错误:
[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.
我已经停止了默认网站,但我仍然收到同样的错误,因为绑定(bind)已经存在。
我已尝试使用 IIS Web 应用程序管理任务来删除默认网站上的绑定(bind),但似乎没有办法做到这一点。我没有看到将执行此任务的其他任务。
我正在尝试通过 Azure Devops 自动执行此操作,以便将来部署,因此我不必手动更改绑定(bind)或删除默认网站。
最佳答案
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.
根据我的经验,您可以使用以下脚本在 IIS Web App Manage
任务之前添加 Run PowerShell on Target Machines
任务
Get-WebBinding -Port 80 -Name "Default Web Site" | Remove-WebBinding
关于iis - Azure 网站部署到已经有 "Default web site"的机器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54446426/