Azure website deployment to machine that already has a “Default web site”

眉间皱痕 提交于 2020-07-21 05:20:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!