Azure函数应用无法访问Azure SQL服务器-提示需要在SQL服务器中添加客户端IP

3
当我的Azure函数应用程序试图连接到Azure SQL服务器时,会出现以下异常。
Cannot open server 'my-sql-sever' requested by the login. Client with IP address '52.165.228.212' 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.

当我的Azure函数应用程序尝试连接Azure SQL Server时,会出现以下异常。
无法打开由登录请求的服务器“my-sql-sever”。不允许使用IP地址“52.165.228.212”的客户端访问该服务器。要启用访问,请使用Windows Azure管理门户或运行sp_set_firewall_rule在主数据库上创建防火墙规则以针对此IP地址或地址范围。这可能需要长达五分钟才能生效。 我认为默认情况下所有Azure SQL数据库的IP都被添加到Azure函数的白名单中。
请提供建议。
谢谢, Siraj

根据错误提示,您需要将IP地址“52.165.228.212”添加到SQL服务器的防火墙中。 - Nancy Xiong
1
我遇到了相同的错误,但每次执行该函数时IP地址都会更改。@NancyXiong - dduque
2个回答

4

1
我们需要将我们的函数应用程序托管的IP地址列入白名单。这可以在配置设置中找到。通常是一个范围。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接