5

我有一个 SQL Azure 数据库和一个带有连接到数据库的应用程序的 Azure 虚拟机。

  • 它们位于同一个数据中心并在同一个 Azure 订阅下。

  • 我将虚拟机的公共虚拟 IP 添加到管理门户的服务器配置页面中允许的 IP 地址列表中。

  • Windows Azure 服务在“允许的服务”部分标记为“是”。

尝试连接时,我收到异常:“不允许 IP 地址为‘xxxx’的客户端访问服务器。”,其中 xxxx 是 VM 的内部 IP。我对在允许的 IP 规则中使用内部 IP 犹豫不决。SQL Azure 在连接期间不应该看到 VM 的公共 IP 吗?

4

2 回答 2

2

我对在允许的 IP 规则中使用内部 IP 犹豫不决。SQL Azure 在连接期间不应该看到 VM 的公共 IP 吗?

呼叫是通过内部网络进行的,因此永远不要真正离开数据中心。为什么不通过在 Azure 数据库上打开以下 IP 范围来添加如下规则以仅允许内部调用:

10.0.0.0 to 10.0.0.255

在上述情况下,您无需担心 VM 上的临时 IP。

于 2013-03-26T11:31:24.830 回答
1

Perhaps try looking at the azure cmdlets that allow you to manage firewall rules by script. You could add a start up job to update a specific rule with the new IP the vm should it change do to a migration or reboot.

Specificially these powershell cmdlets:

  • New-SqlAzureFirewallRule - Adds a new Sql Azure firewall rule to a server.
  • Get-SqlAzureFirewallRules - Returns the firewall rules for the specified Sql Azure server.
  • Remove-SqlAzureFirewallRule - Removes an existing Sql Azure fireall rule.

Sql Azure Cmdlets

于 2013-03-26T15:03:27.537 回答