Azure资源SQL Server防火墙设置不工作



我在Azure中有一个SQL Server资源;在它的防火墙设置中,我添加了一个防火墙规则来接受来自两个不同AKS(Kubernetes集群(的公共IP。然后我创建了一个连接到这个数据库的python脚本。连接可以从一个集群进行,但不能从另一个集群。

群集A和群集B公共IP尝试连接到Azure资源设置:

集群A抛出错误:

pyodbc.ProgrammingError: ('42000', "[42000] [unixODBC][Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot open server '' requested by the login. Client with IP address '' is not allowed to access the server.  To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect. (40615) (SQLDriverConnect

集群B抛出错误:

pyodbc.ProgrammingError: ('42000', "[42000] [unixODBC][Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot open server '' requested by the login. Client is not allowed to access the server. (40914) (SQLDriverConnect)")

将群集A IP添加到防火墙设置后,连接将按预期工作。将群集B IP添加到防火墙设置后,会抛出相同的错误。

我没有创建任何一个集群。感觉好像有什么东西阻止了群集B访问此资源。我想知道在哪里可以找到阻止连接的东西。

您可以在此处阅读错误40914。看起来您需要访问群集B的子网,而不是其外部IP。这两个集群可能具有不同的网络设置。

最新更新