Mohammed Sirajuddin
Mohammed Sirajuddin

Reputation: 71

Azure Function App not able to access Azure SQL server- saying Client IP need to be added in SQL Server

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

Upvotes: 3

Views: 3628

Answers (2)

Mohammed Sirajuddin
Mohammed Sirajuddin

Reputation: 71

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

Upvotes: 1

Martin Brandl
Martin Brandl

Reputation: 58931

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)

Upvotes: 4

Related Questions