When running Azure SQL, we can use the option Firewalls and virtual networks to configure how the DB administrator and applications will have access to the SQL server and databases. When trying to connect from home, in some cases (especially in DEV environments that you may not even be connected to the corporate network to test your code), you may want to allow your workstation to be able to connect. There are a couple of ways to connect your home computer to your Azure SQL server and database. The first one is by adding a client IP and use your public IP on the SQL server.
The second method is using SQL Management Studio on your workstation. Type the server name (make sure to use suffix .database.windows.net) and provide the credentials that you defined during SQL server creation. You will be prompt to authenticate on Microsoft Azure, and after the authentication is successful, a dialogue box to create a new firewall rule with your existing IP will be displayed. Just click OK, and that will grant you access to the feature above to connect to the SQL server.
More Quick Tips articles
- Monitor your Azure VM from your mobile device by scanning a QR code
- Switching shells using command line in Cloud Shell
- Using environment variables in ARM templates
- Rename Azure subscriptions and find your environments faster
- Removing root role assignments in Azure using PowerShell