Accessing Azure Database - Firewall Issue

4.9k Views Asked by At

As a team we are working on project whose database is hosted in Azure. Since I have Azure management Portal I am adding my IP Address to Management Portal. I cannot add others IP Address of my Team members each and every time.

Is there any way to access the Database hosted in azure without adding IP Address each and every time?

4

There are 4 best solutions below

0
Shantanu On BEST ANSWER

You need to specify which IPs or IP ranges have access to your DB. If your IPs change dynamically and frequently, it is better to add an IP range on the portal.

https://azure.microsoft.com/en-us/documentation/articles/sql-database-configure-firewall-settings/

The dirty alternative is to allow all IPs to access your DB ( 0.0.0.0 to 255.255.255.255). Of course, this is not recommended and will mean any IP can access your DB if they know the connection string. If you are testing out something quickly and want to avoid having to add IP ranges for now, this could be an okay alternative, though. However, remember to remove this rule and set a specific firewall rule once you are done testing.

4
BrianAtkins On

Yes, you can add firewall rules (ranges) at the server level on portal.azure.com, here is a document that shows you how to do this: How to: Configure Firewall Settings (Azure SQL Database), this can be acomplished by either the portal or powershell scripts.

0
Eric Barr On

Both of the other answers here link to the same Microsoft article, and it seems that the Azure portal has changed since that article was written. The new way to access the Firewall settings is pictured below. After you choose your SQL database and the Essentials and other tiles are shown to the right, click on the "...More" menu and choose "Set Server Firewall". Then you will be presented with another panel where you can create a new rule for an IP range by specifying a start IP and end IP, or you can make a rule to allow a single IP by making the start IP and end IP the same.

enter image description here

0
RBILLC On

It is correct that allowing the full range of IPs (0.0.0.0 to 255.255.255.255) will allow anyone to attempt to access your database. Although if Azure active directory password authentication is configured, you will still need a valid Username & Password to connect to the SQL Server.