gpt4 book ai didi

c++ - 从 SQL Server 的 Azure 帐户获取 IP

转载 作者:行者123 更新时间:2023-11-30 04:48:19 25 4
gpt4 key购买 nike

我在 Visual Studio 中使用 SQL Server 创建了一个数据库。我有一个 Azure 帐户,我想在其中存储我的数据。问题是我需要从 Azure 帐户获取 IP 地址才能将其写入代码行。

这是我指的行

 (SQLDriverConnect(SQLConnectionHandle, NULL, (SQLCHAR*)"DRIVER=(SQL Server); SERVER=, ; DATABASE= projectBD; UID= myID; PWD= myPW", SQL_NTS, retConString, 1024, NULL, SQL_DRIVER_NOPROMPT)) 

在SERVER部分我需要写服务器的IP,但我真的不知道如何获取它。

非常感谢您的帮助

最佳答案

默认情况下,您使用 SQL Server 连接的 DNS 名称。这类似于 yourservername.database.windows.net

有关 Azure SQL 连接的详细信息,请参阅 Azure SQL Connectivity Architecture

摘自该文章:

Connection Policy Proxy: all connections are proxied via the Azure SQL Database gateways. To enable connectivity, the client must have outbound firewall rules that allow only the Azure SQL Database gateway IP addresses (usually two IP addresses per region).

还有

If you are connecting from outside Azure, your connections have a connection policy of Proxy by default. A policy of Proxy means that the TCP session is established via the Azure SQL Database gateway and all subsequent packets flow via the gateway.

本文还列出了所有Azure SQL Database gateway IP addresses您可以用来确定要使用的 IP 地址。

关于c++ - 从 SQL Server 的 Azure 帐户获取 IP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55900007/

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