gpt4 book ai didi

Azure 云服务 - 访问被拒绝(端口绑定(bind))

转载 作者:行者123 更新时间:2023-12-02 07:50:34 25 4
gpt4 key购买 nike

我正在使用 Visual Studio 2013 将 WorkerRole 发布到 Azure。 WorkerRole 应绑定(bind)在端口 80 上,并启动 Owin WebApp:

WebApp.Start<Startup>(new StartOptions(url: baseUri));

如果我在 Azure 模拟器上本地运行它,一切正常,但当我在 Azure 上实时运行它时,它会失败。相关的异常是:

Inner Exception: Access is denied
at System.Net.HttpListener.AddAllPrefixes()
at System.Net.HttpListener.Start()
at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory)
at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, IDictionary`2 properties)

我尝试通过 RDP 访问实例并添加 ACL 规则,这是本地计算机上此类错误的常见来源

netsh http add urlacl url=http://+:80/ user=Everyone

但不成功,仍然给出同样的错误。

有人遇到过这个问题并可以为我指明解决该问题的正确方向吗?

谢谢!

最佳答案

首先,使用具有 80 绑定(bind)的 WorkerRole 来使用 WebRole 并打开 80 端口是很奇怪的。

下一步。您似乎尚未为 WorkerRole 定义输入端点,并且 Azure 防火墙关闭了所有端口。因此,要打开 80 端口,请尝试在 ServiceDefinition.csdef 文件中或在 WorkerRole 属性窗口的“Endpoints”选项卡中指定输入端点。发布到 Azure 时,它​​应该连接此配置以打开端口。

因此,简而言之,请尝试使用以下内容更新您的 ServiceDefinition.csdef:

<ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WorkerRole name="WorkerRole1">
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" localPort="80" />
</Endpoints>
</WorkerRole>
</ServiceDefinition>

另请查看这些文档:Enable Communication for Role Instances in Azure , WorkerRole Schema , How to Configure Cloud Services

希望对你有帮助!

关于Azure 云服务 - 访问被拒绝(端口绑定(bind)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30501102/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com