When you want to connect to the database from on-premises or remote tools, we need to configure a server-level firewall rule for the database. The firewall is created at the database server level for single and pooled databases. This prevents a client application from connecting to the server of any of its single or pooled databases.
To connect to the server from an IP address outside Azure, you need to create a firewall rule for a specific IP address or range of addresses.
To create a firewall rule, we have to take the following steps:
- When the deployment is finished, open the resource. The overview blade is automatically displayed. In the top menu, select Set server firewall, as shown in the following screenshot:
Overview blade of the database
- In the Firewall settings page, you can add your current client IP address, by clicking the + Add client IP button in the top menu. This IP address will then automatically be added to the rules, as can be seen in the following screenshot:
Adding a client IP address
- Click Save.
- We can now connect from outside of Azure to the database.
In the next section, we are going to create a new table in the database, using the Query Editor.