3

I have my SQL database on Azure devOpos.
To access this, I have set my IP Address in Firewall setting but IP changes daily or twice a day, So I have to set again and again.

Else, I get this error.

Cannot open server 'abcdb-dev' requested by the login. Client with IP address '106.215.195.185' 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.

So, how to overcome this problem ? how can I access my database just by connection string without setting any firewall settings of IP.

GOPAL SHARMA
  • 657
  • 2
  • 12
  • 37
  • You *can* but it's incredibly dangerous, as you would be opening your instance up to the entire internet and thus it *will* suffer brute force attacks once someone malicious gets the domain path for it. – Thom A Mar 04 '22 at 11:12
  • Look at this post: [Accessing Azure SQL database from anywhere](https://stackoverflow.com/questions/48751895/accessing-azure-sql-database-from-anywhere) – Ahmed Eissa Sep 05 '22 at 09:21

1 Answers1

1

As per Azure SQL Database IP firewall rules -

Dynamic IP address:

If you have an internet connection that uses dynamic IP addressing and you have trouble getting through the firewall, try one of the following solutions:

  • Ask your internet service provider for the IP address range that's assigned to your client computers that access the server. Add that IP address range as an IP firewall rule.
  • Get static IP addressing instead for your client computers. Add the IP addresses as IP firewall rules.

Connection string is an alternative of username and password. You still need to whitelist the IP address to access the database.

You can also refer the answer on this similar requirement in another SO thread: Reach Azure SQL database with dynamic IP addresses

Utkarsh Pal
  • 4,079
  • 1
  • 5
  • 14