gpt4 book ai didi

Azure 虚拟网络混合连接

转载 作者:行者123 更新时间:2023-12-02 09:15:44 26 4
gpt4 key购买 nike

我在网络内设置了 Azure 虚拟网络和 VM。我已在虚拟机上安装了混合连接管理器应用程序。

我还有一个 Azure 应用服务,并且我在它和 VM 之间创建了混合连接,并且它们都声称它们能够愉快地相互连接。

还在虚拟机上我安装了一个正在监听 http://localhost:1234 的应用程序

有人可以告诉我我使用应用服务中的哪个 IP 来与 http://localhost:1234 进行通信吗?在虚拟机上?例如是[VM内部IP]:1234还是[VM公共(public)IP]:1234,还是其他什么。目前没有任何消息,所以我想确保 IP 地址不是问题。

最佳答案

只需使用虚拟机的计算机名称。例如,从应用服务中的代码调用 SQLSRV009:1234。门户中的混合连接定义应反射(reflect)相同的名称(与计算机名称相同,与您从代码中调用的名称相同)。

查看这份写得很好的指南,了解完整情况 — https://learn.microsoft.com/en-us/azure/biztalk-services/integration-hybrid-connection-create-manage

It is possible to set a Hybrid Connection endpoint to an IP address. If you use an IP address, you may or may not reach the on-premises resource, depending on your client.

The Hybrid Connection depends on the client doing a DNS lookup. In most cases, the client is your application code. If the client does not perform a DNS lookup, (it does not try to resolve the IP address as if it were a domain name (x.x.x.x)), then traffic is not sent through the Hybrid Connection.

For example (pseudocode), you define 10.4.5.6 as your on-premises host: The following scenario works:
Application code -> GetHostByName("10.4.5.6") -> Resolves to 127.0.0.3 -> Connect("127.0.0.3") -> Hybrid Connection -> on-prem host

The following scenario doesn't work:
Application code -> Connect("10.4.5.6") -> ?? -> No route to host

还要让您的应用程序监听 0.0.0.0 或私有(private) IP,因为我不太确定 localhost 是否可以与 HC 配合使用。

为什么不对 Web 应用程序使用 VNET 集成?您需要做的就是在 VNET 中创建基于路由 (IKEv2) VPN 网关,如下所示 — https://learn.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet

关于Azure 虚拟网络混合连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47290907/

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