In First part of this series we talked about the concept of Azure SQL services as a platform (PAAS), also we demonstrate how this service is easy for use for SQL admins and when the Admins can use it, in the second part we tried to show some technical step to implement Azure SQL database , also we demonstrate the difference between each type of services in Azure SQL.
In this part we will continue in how to use and access the Azure SQL database.
Since I am not SQL admin or a developer, I will not go deeply in using SQL databases.
in part two we already created a database in Azure called AzureDummiesDB as below:
Now if you click in the database, you can go to the Dashboard tab as below to obtain the server name which will be used to connect to DB through SQL management studio:
If you scroll down the page you will have many information about your database in the right of page:
The most important info in above snapshot is the server name, the server name will be used to connect to the database, in this example the server name is: ychy6zsdx3.database.windows.net
Now go to your SQL management studio and fill the server name, username and password (user name and password already specified in the step where you create the SQL server in part 2), then click connect:
The credential used is already chosen in the create new server wizard as below:
when I click in connect button it gave me the error below:
the above error is very important, it mentioned that my device public IP is not allowed to connect to the Azure database, and this is one of the security feature in Azure SQL, you can specify who can connect to the database by specifying the allowed IP in Azure portal, Now lets go to the portal to add my Public IP to the while list, Adding the allowed IP will be in the server level, so we need to go to the servers:
After click on the correct server, go to configure tab, you can notice that it obtain the current device public IP automatically, you can add it by clicking on the ADD TO THE ALLOWED IP ADDRESSES or you can specify any other public IP:
I will add the current public IP:
Finally, click the save button in the bottom of the page:
Now go to SQL management studio and try to connect again, you can work in this database as any other database:
The allowed Public IP list is in server level, so if you have more than database in same server, you cannot specify for each DB different allowed list, in this case you should implement each database in separate server.
Before finalize this part, developers usually need something called connection string in order to connect their applications or websites to the database, to obtain this value fro Azure SQL, from the portal go to the database and click on it, then click in Dashboard tab:
in the right pane of the page, click in show connection string, it will display it for you to use it in your application:
so hope I can deliver the concept of azure SQL to you in a simple way, if you have any comment please reply to the post so I can help you.
Ahmad Yasin in a Microsoft Cloud Engineer and the publisher of
AzureDummies blog. He also hold many certificates in office 365
and windows azure including Developing Microsoft Azure Solutions, Implementing Microsoft Azure Infrastructure Solutions
and MCSA office 365.