从 SQL 服务器的 Azure 帐户获取 IP
Get the IP from an Azure account for SQL Server
我在 Visual Studio 中使用 SQL 服务器创建了一个数据库。我有一个 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 服务器的 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.
本文还列出了您可以用来确定要使用的 IP 地址的所有 Azure SQL Database gateway IP addresses。
我在 Visual Studio 中使用 SQL 服务器创建了一个数据库。我有一个 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 服务器的 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 ofProxy
means that the TCP session is established via the Azure SQL Database gateway and all subsequent packets flow via the gateway.
本文还列出了您可以用来确定要使用的 IP 地址的所有 Azure SQL Database gateway IP addresses。