SQL Azure - Testing Database Connectivity Using Azure Portal


Overview:


Using SQL Azure we can create our own database server and the databases based on the requirement of our application created using the Azure management portal (Check the article on how to Create New Server and Database). Once we created our new servers and databases we need to do a manual check of testing the connectivity using the credentials before we provide the credentials to the development team to use it for the front end application.
Normally in a standard SQL Server edition locally we can test the connectivity by giving the username and password valid for that database server and check if the connection is established correctly or not. In the same manner here we are going to do that using the Azure portal. Let's see how to do this step by step.

Steps:


Log in to the Azure portal using the below link. You will see the screen look similar to below.
http://www.microsoft.com/windowsazure/
image
Login to the portal using your Microsoft Windows Live credentials with Azure credentials to the management portal and you will see the screen as shown in the screen below:
image
Now we can see the Database Menu at the bottom left; click on that and then the Database Subscription window will be shown as shown in the screen below:
image
Clicking on the subscription name will provide the complete details of the server created and the new database created as shown in the screen below:
image
Now to test the connectivity of the server and the database, select the particular database (LearnAzure) and we click on the Test Connectivity button at the top of the menu tool bar as shown in the screen below:
image
Clicking on Test Connectivity will open a popup as shown in the screen below:
image
Now we need to provide the password which we created during configuration of the new database and click on the Connect button; we may or may not get a error window as shown in the screen below:
image
This error message indicates that the IP is not added to the firewall which we need to provide in order to have a secure connection to the SQL Azure database. So to overcome this error copy the IP address from the error message and click on the close button.
Now we can see the Firewall Rules tab with the added IP address as shown in the screen below:
image
When that button is clicked a list of IP addresses added will drop down as shown in the screen below. Here we need to click on the ADD button to add the new IP address to the firewall.
image
After adding the IP address we can see the IP added to the list as shown in the screen below:
image
Now Click on the Test connectivity button and give the valid password and click on Connect button to test the connectivity as shown in the screen below:
image
We can see the result as Success at the bottom as shown in the screen below if the credentials are valid. :)
image

Conclusion:


So in this article we have seen on how to test the connectivity of the databases created using the inbuilt option provided in the Azure management portal.