postgresql - 如何将 AzureContainerApp 连接到不向 Internet 开放的 Azure 托管 PostgreSQL 灵活服务器

标签 postgresql azure networking azure-container-apps

我花了一天时间试图解决这个问题,所以我真的希望有人能给我指出正确的方向。

我们有一个托管在 Microsoft Azure 上的 PostgreSQL(灵活服务器),该服务器没有公共(public)互联网访问权限。 (在自己的资源组中)

我们还选择了需要连接到此 PostgreSQL 服务器的 Azure ContainerApp(使用托管环境),但我一直不知道如何实现这一点?

使用 AWS,我可以在大约 2 秒内通过安全组完成此任务,但容器应用程序在托管环境中运行的方式似乎让我有些头疼。

有人能指出我正确的方向吗?

最佳答案

我已按照以下步骤将 AzureContainerApp 连接到不向 Internet 开放的 Azure 托管 PostgreSQL 灵活服务器。

第 1 步:创建具有两个子网的虚拟网络。 enter image description here

第 2 步:创建 Postgres SQL 服务器时,在连接方法中选择专用访问(VNet 集成),然后选择 vnet 和子网在步骤 1 中创建。

enter image description here

步骤 3: 接下来,在创建容器应用程序时,创建新的容器应用程序环境并转到网络并选择在步骤 1 中创建的 vnet。 enter image description here

enter image description here

第 4 步:现在为了检查从容器应用程序到 postgres sql 服务器的连接,我连接到容器并使用 pingtelnet 验证命令。

telnet <sql-server-url> 5432
ping <sql-server-url>

enter image description here enter image description here

关于postgresql - 如何将 AzureContainerApp 连接到不向 Internet 开放的 Azure 托管 PostgreSQL 灵活服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76602470/

相关文章:

asp.net - Npgsql.NpgsqlException : ERROR: 42601: syntax error at or near "where"

postgresql - PostgreSQL 中的函数名称不区分大小写吗?

azure - 如何调试承载错误="invalid_token"

azure - VS 2015 Web 部署到 Azure Web App Staging 部署槽覆盖 PROD 槽

python - 判断host是否为localhost

mysql - 如何在表中找不到数据时将计数设为 0?

sql - 如何在单个 SELECT 查询中获取用户今天和本月的事件计数

Azure WebApp Docker Compose 私有(private)存储库

c++ - 如何检测端口是否已在服务器端使用(在 Windows 上的 C++ 中)?

linux - Linux 网络上的 SoftIRQ 和快速数据包处理