运行 ACI 与 SQL 服务器本地

Running ACI with SQL Server on premises

我在 Azure 中有一个容器(linux .NET Core)运行。此应用程序从 Azure 服务总线读取信息并将信息写入本地数据库。

与 ASB 的连接工作正常,但是当应用程序尝试连接到 SQL 服务器时,出现超时。最初,我是 运行 没有网络设置的容器('None' 选项)。然后我去了 public,它现在给了我一个 IP 地址。

我的基础架构团队将此 IP 添加到我们的防火墙,但 Azure 正在尝试使用不同的 IP 地址访问它,或者连接从未离开 Docker 环境。

ps.: 我有一个应用服务 运行 (.NET Core API),它 连接到同一个 SQL服务器(相同的IP地址)正确。

建议?

因为从 Azure 容器组传出的 IP 地址是随机的 Azure cloud IP list, you can not directly add its IP to the firewall. You can vote up this feature request 用于从容器组开始的出站流量使用相同的公开 public IP。

目前,您可以 deploy container instances into an Azure virtual network, then the container could communicate with on-premises resources through a VPN gateway or ExpressRoute. For more details, you could see enable containers to use Azure Virtual Network capabilities