3

Getting below exception when my Azure Function App tries to connect with Azure SQL Server.

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.

Getting below exception when my Azure Function App tries to connect with Azure SQL Server.

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. I was in impression that by default all Azure IPs of SQL database are whitelisted to Azure Fuction.

Please suggest.

Thanks, Siraj

  • As the error mentioned, you need to add IP address '52.165.228.212' to your firewall of SQL server. – Nancy Oct 25 '19 at 06:46
  • 1
    I have the same error, but the IP address changes everytime the function is executed. @NancyXiong – dduque Oct 06 '20 at 22:08

2 Answers2

4

You can either configure your SQL to allow connections from inside Azure or you have to create a firewall rule for the Azure Function IP address (see Create and manage IP firewall rules)

Martin Brandl
  • 56,134
  • 13
  • 133
  • 172
1

We need to white list the our function app hosted IP address. This can be fund the configuration settings. This is typically a range.