将Azure网站部署到已经具有“默认网站"的计算机上 [英] Azure website deployment to machine that already has a "Default web site"

查看:56
本文介绍了将Azure网站部署到已经具有“默认网站"的计算机上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Azure Devops将网站部署到具有重新配置的默认网站"的IIS服务器.从端口80上的绑定开始.

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.

我希望我的网站在端口80上运行.

I want my website to run on port 80.

我正在使用"IIS Web App管理"(IIS Web App Manage)任务.在此计算机上运行部署时,出现错误:

I am using the "IIS Web App Manage" task. When I run my deployment on this machine, I get an error:

[错误]绑定(http/*:80:)已经存在于其他网站(站点"默认网站"(id:1,bindings:http/*:80:,state:stopped)" ;),更改端口,然后重试该操作.

我已经停止了默认网站,但是由于绑定已经存在,我仍然遇到相同的错误.

I have stopped the default web site but I still get the same error because the binding already exists.

我尝试使用IIS Web App管理任务删除默认网站上的绑定,但是似乎没有一种方法可以执行此操作.我看不到其他将执行此任务的任务.

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.

我正在尝试通过Azure Devops将其自动化以用于将来的部署,因此不必手动更改绑定或手动删除默认网站.

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.

推荐答案

我正在尝试通过Azure Devops将其自动化以用于将来的部署,因此不必手动更改绑定或手动删除默认网站.

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任务

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

这篇关于将Azure网站部署到已经具有“默认网站"的计算机上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆