Learning new methods of working with SQL Server can always be challenging. I found the new learning coming my way while connecting to Azure SQL DB. I was confronted with an error and I was not sure where to start. So this blog is like a travel log of my learning to connect to an Azure SQL DB which looks almost same as what an onpremise SQL Server looks like. When I was connecting to Azure SQL DB, I was getting an error as shown below:
But the basic information will be around how did I get the connection string to connect to my database. It can be got from the azure portal. As I goto the server and check on the information, I will be presented with the server details which was being used in our SQL Server Management Studio.
Now to manage the error message, look at the Dashboard and click on the “Manage allowed IP addresses” from your machine where we are getting this error.
Once in this page, you will be able to see the current IP address. This is the same address that you are currently using to connect to Azure SQL DB. Click on the next and this must add the same to the grid below. This is an important step because you don’t want any IP address to connect to SQL Server and this has been used by a number of companies when accessing databases on the cloud to control access.
When I tried to the same using SQL Server 2016 Management Studio, I saw it also gave a different point of entry and a pop-up which can be used to connect to Azure and add the current IP address or the IP address ranges.
Once this has been done, we will be able to connect to Azure SQL DB via SQL Server Management Studio. As you can see, the icon for the server connected also looks modern and is a great way to work with another form of SQL Server.
As I sign off now, would like to understand how many of you have had an opportunity to work on Azure? What has been your experience? Do let me know via comments below.
Reference: Pinal Dave (https://blog.sqlauthority.com)