Access Control Through Firewall In An Existing Azure SQL Database

Introduction

 
Nowadays, many people are working from home due to pandemic situation. Most IT companies are using Azure services, including Azure SQL Database. We have a global team to work collaboratively and because of work from home policies, most of the time our network changes. Thus, the IP address of our machine changes, and we need to give access to our database whenever it gets changed. On the other hand, there are always security concerns with our databases and it is one of the best practices to secure databases through Firewall protection. That is the reason I am going to write this blog to guide how to allow access to Azure Database through Firewall setup on an existing database whenever need. This way, anyone who has Azure Database right authority (such as the owner, admin, and contributor role), they can log in to the Azure portal and manage access control to the Database.
 
This write-up will help and guide users to set up a firewall in the Azure SQL Database.
 

Steps

  • Go to your Azure site.
  • Go to SQL Databases and click on Database which you want to set up a firewall.
Access Control Through Firewall in Existing Azure SQL Database
  • The following screen will appear. Click on Set Server Firewall, as depicted below.
Access Control Through Firewall in Existing Azure SQL Database
  • There can be 2 cases of setup for Firewall
Case 1
 
If you want to give access to the currently logged in the computer on that database, then you must add the IP of the current computer from Firewall settings.
 
By clicking Add Client IP, you can add the IP of your computer from which you are login into the Azure site. Subsequently, Save options will be enabled, and click on Save. After that, you will be able to access the Azure database from your PC.
  
Case 2
 
If you want to add and allow another computer/device IP to access Azure Database, then fill in the information Rule Name, Start IP, End IP and then click on Save.
 
Note
Start IP, End IP will be the IP of the device to which you want to give access.
 
Access Control Through Firewall in Existing Azure SQL Database
 
In this way, we can configure IP addresses to access Azure SQL Database. I hope, this write-up helps to set up and control access to the Azure SQL database through Firewall setup.