iis - Azure 网站部署到已经有 "Default web site"的机器

标签 iis azure-devops

我正在尝试通过 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

enter image description here

关于iis - Azure 网站部署到已经有 "Default web site"的机器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54446426/

相关文章:

php - 调用未定义函数define()

powershell - Azure DevOps 托管代理管道 "Unable to locate executable file: ' Powershell'

发布管道中的 Azure DevOps 日志记录命令

php - 可扩展的 WordPress 设置

asp.net - 如何在 ASP.NET 部署脚本中包含应用程序池规范?

asp.net - 单个站点上的多个应用程序 - session 和表单例份验证范围

c# - 在同一主机和端口下运行多个应用程序

azure-devops - dotnet 构建与在 Azure DevOps 上发布

azure - 在第一个管道上成功运行后触发第二个 Azure 管道

Azure DevOps API 添加公钥