microsoft azure sql database allow ip addresses Edit

Murugan Andezuthu Dharmaratnam | 17 September 2020 | 713

Exception

Exception Cannot open server 'servername' requested by the login. Client with IP address '104.41.XXX.XXX' 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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open server 'servername' requested by the login. Client with IP address '104.41.xxx.xxx' 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.

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Solution

solution is to add ip address to sql server firewall

  1. open the Azure portal.
  2. open SQL server
  3. scroll down and select "Firewall and virtual networks" under Security
  4. add the ip address starting
  5. click on save

starting ip and ending ip can be the same.