Introduction
This article demonstrates how to create an Azure SQL Database, set the Firewall rule, and connect through the SQL Server Management Studio.
Prerequisites
First of all, login to the Azure portal. Click here to go Azure login page.
After signing into the Azure portal, click on the SQL databases from the left panel of the website, as shown in the below image.
Now, click on "Add".
Enter the Database name. Here, we are going to give the database name as employee, Resource group name as vivek, and selecting source as a Blank database.
Now, click on the "Configure required settings for the server "
>> click on the Create a new server
>> enter the required details for Server name, Server admin login, Password, Confirm password, Choose Location
>> select the checkbox for allowing Azure service to access Server and then click on the Select button.
Here, I am giving Server name as a vivek-kumar so the Database Server name will be vivek-kumar.database.windows.net and giving Server Admin login name as vivekAdmin.
Below is the image for same.
Now, after filling all the necessary information, click on the "Create" button.
We will get notification message for "Deployments succeeded".
Now, click on "All resources" from the left panel of the website.
We will see the Server name and the database name as vivek-kumar and employee respectively.
Click on just created database employee as in the below image.
Click on the "Set server firewall" as in below image for allowing the permission from your computer.
Now, enter the rule name as per your convenience and enter the IP address of the system from where we are going to use the SQL Server Management Studio to connect the Azure SQL Database.
Here, we can also give permission for continuous series of IP address by providing the Start IP address and End IP address or we can allow only for one system by entering same IP address in the both field.
We can also see the current system’s IP address in the Firewall settings screen.
After entering the IP address details, click on the "Save" button as in the below image.
We will get success message, Click on "OK" button as in the below image.
Open the SQL Server Management Studio and enter the required information and click on the "Connect" button.
Yes, we got connected to Azure SQL DB. Now, click on the "New Query".
Now, select the employee from database dropdown menu and write SQL Query for creating the table named as Name and execute it.
- CREATE TABLE Name (
- PersonID int,
- FirstName varchar(100),
- LastName varchar(100)
- );
Summary
In this article, we have learned how to create an Azure SQL Database, set the firewall rule for the client system(s), and use the Azure SQL Database through SQL Server Management Studio.