Deploying An Azure SQL Database In Microsoft Azure Portal

Introduction

In this article, I am going to demonstrate how to create , configure and run sample SQL queries in Microsoft Azure portal using the SQL database. It consists of three segments,
  • Create an Azure SQL Database.
  • Configuring the Firewall for the server.
  • Execute Sample Queries .
Prerequisite

Microsoft Azure Subscription. If you don't have a subscription go to this link to Free Trial!!!

What is Azure SQL?

SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems.SQL Azure is Microsoft's cloud database service. Based on SQL Server database technology and built on Microsoft's Windows Azure cloud computing platform, SQL Azure enables organizations to store relational data in the cloud and quickly scale the size of their databases up or down as business needs change.

Follow these steps to create an Azure SQL Database

Sign-in into the Azure portal.



In the Azure portal , choose "+" then navigate to the "Databases" and then chose the "SQL Database" . It opens the SQL Database creation blade and fill the required details in the desired fields.



For creating the new server, choose the server in the blade, then it opens the server blade and then you may choose the server or create the new server. Give the necessary details to create the server and then press "select" to create the server.





Choose the desired pricing tier for the usage of the disks and for the performance of our Database by DTU and press "Apply" to ensure the pricing tier.

What is DTU?

A DTU is a unit of measurement for the performance of a service tier and is a summary of several database characteristics. Each service tier has a certain number of DTUs assigned to it as an easy way to compare the performance level of one tier versus another. (Database Throughput Unit ) DTUs provide a way to describe the relative capacity of a performance level of Basic, Standard, and Premium databases. DTUs are based on a blended measure of CPU, memory, reads, and writes. As DTUs increase, the power offered by the performance level increases.



Then Choose the Database to pin in the dashboard and also press the "create" button to create the Database by filling the above details.
The Database is shown in the dashboard after deployment. 

Follow these steps to configure the Firewall to the Server

In our database on the overview tab , choose the "Set server firewall" that leads to set the firewall for our database.



In the firewall settings blade , choose "Add client IP" to add our current IP address to the new firewall rule.



And then press "Save" on the toolbar to save the Firewall rule to our currently created Database and then press "Ok" and go back to our database blade.That's all we created.



Follow these steps to Run the sample Queries

In our Database blade , choose the "Tools" in the toolbar then the toolpage opens.



In the tool page blade , choose the "Query Editor(preview)" and choose the Preview terms checkbox, and then click OK. The Query editor page opens.



In the Query editor blade , Click Login in the toolbar then select SQL server authentication and then provide the server admin login and password that you created earlier and then press "ok" to login into our Database.



In the Query editor it allows the admin; paste the query to work in the created database.
  1. SELECT TOP10 pc.Name as CategoryName, p.name as ProductName  
  2. FROM SalesLT.ProductCategory pc  
  3. JOIN SalesLT.Product p  
  4. ON pc.productcategoryid = p.productcategoryid;  


And then press "Run" on the toolbar to run the Query and it shows the result.



Summary

I hope that you understood how to create and configure the firewall and how  to run the sample queries using the Query editor successfully using the Microsoft Azure Portal.

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now