Connecting to Azure SQL Database
As mentioned earlier, when you create an Azure Database via the Azure portal, all Azure services will be allowed to access this database with no further configuration.
However, when you want to connect to the database from anywhere else, there is some configuration that needs to be done.
Server-level firewall rule
To allow access to an Azure SQL Database from somewhere else, you will have to set a server-level firewall rule, as described in the following steps:
- Navigate to the database blade, and click on
Set server firewall
, as shown in the following figure:

Figure 4.9: PacktPubDB settings
- Once you have clicked on it, you will be navigated to a new blade, where you can create firewall rules for the Azure SQL Server, as shown in the following screenshot:

Figure 4.10: Azure SQL Server firewall settings
- Within this blade, you can add IP addresses that have access to the database we created earlier. This can be done either as an IP address range, where you can specify...