The first question that might come to mind is why should I create an Azure SQL database and what makes it unique from other kinds of databases.
I will start by explaining all the benefits of having your database stored in the cloud rather than having it on your local machine.
Requirements and Availability for Azure SQL database:
An Azure Account is required to create an Azure SQL database. If you don’t already have one, you can sign up for a free Azure account on their website. Intermediate knowledge of SQL and Azure is needed.
After creating your free account, head to the Azure portal and put in all the necessary login credentials.
What is the Azure SQL database?
This is a managed cloud database in the Azure Cloud platform that runs on the SQL Server database engine.
Advantages of Azure SQL database
- High-speed operation with extremely little downtime.
- Little or no downtime.
Follow these steps with me on how to create your first single Database in Microsoft Azure SQL database.
Go to the Azure Portal link above and log in, in the Azure Service homepage you will see the SQL database.
Click on it, and you will be redirected to another page.
On the new page click on the “+create” button to create a new database.
You will need to create a new resource group for your SQL database. Click on the “Create new” button to create a new resource and put a valid name that can be accepted by Azure then click OK.
For the Database section, you are required to give a name to your database.
Next, you need to create a new server for your database. Click on the “create new” server button and enter the required details for your new server.
Next, you need to configure the database. You must choose the database’s pricing model. The default setup is Gen5, 2 vCores, and 32 GB storage. Other pricing models can be selected by clicking “Configure database.”
At this point, you need to change the “Service tier” from General Purpose (Scalable compute and storage options) to “Basic (For less demanding workloads)”. Since this database is for tutorial purposes much storage capacity is not needed.
At this point, you can skip to the “Review + Create” or further edit the database.
Click on the Next button, which is the “Networking” tab. At this point, you are expected to do the following.
- Select Public endpoint as the Connectivity method.
- Allow Azure services and resources to access this server by selecting “Yes/No” depending on your preference.
- Choose “Yes” for the Add current client IP address option.
The security tab, at this point Microsoft Defender for SQL can be turned on under the Security tab. At the bottom of the page, select Next: Additional settings.
In the additional settings tab, you are provided with 3 options for using existing data. Selecting the “sample” creates an AdventureWorkLT database, which provides useful data tables to query and perform other tasks on rather than having a blank database.
Select Review + create at the bottom of the page
Under the “Notifications” menu, you may monitor the status of the database deployment.
Connect to Azure SQL Database using SQL Server Management Studio
SQL Server Management Studio (SSMS) provides a unified management environment for any SQL system.
All components of SQL Server, Azure SQL Database, Azure SQL Managed Instance, SQL Server on Azure VM, and Azure Synapse Analytics may be accessed, configured, managed, administered, and developed using SSMS.
Now that you have created an Azure SQL database, the next thing you need to do is connect your SSMS to the database.
The following steps below will help you in achieving this task.
From your Azure portal home tab go to SQL database where you will find the database you just created and open.
At this point, you will need to copy the server name and head back to your SQL Server Management Studio.
Firstly, open your SSMS on your system and put in all necessary credentials. Note for this process to work you first need to be logged in to your Azure portal.
At this point we are now connected to the database, all that is left is for us to query the tables in the database and get specific information.
As you can see below, let’s query the top 1000 rows of the “AddressID” table from the AdventureWorkLT database.
The Azure SQL database provides you with so many possibilities and flexibility. You can always adjust your storage capacity depending on the project you currently have at hand. This article is designed to help give a broad overview of the Azure SQL database and how to connect with any SQL server management tool.
Anticipate our next blog, where I show you how to install SQL server management studio in a virtual environment.