Creating Your First Azure SQL Database And Configure Firewall Settings

Introduction

 
In this article we will try to understand Azure SQL database service, and also create our first Azure SQL Server database. We will also configure the required firewall settings to connect Azure SQL using SQL management and Azure studio.
 
Prerequisites
  • Microsoft free account and Azure Credits.
  • Basic knowledge of using Azure Services
In this article, we will cover the following topics:
  • Create a new SQL Server database in Azure 
  • Configure firewall settings to access SQL server outside Azure portal using SQL management and Azure Studio

Step by step to create and configure SQL Server database in Azure

 
Navigate to Azure portal using https://portal.azure.com/ and select SQL database from the left
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
Click on add under SQL database.
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
This will now open the below pop up 
 
Configure a new SQL server instance
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
Select your subscription type.
 
If you have an existing resource group, select the resource group or create new resource group.
 
Specify a valid database name and select server name where this database needs to to created
 
If you don’t have existing server create a new one  by clicking on create new button.
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
Specify your server name and configure admin user credentials for SQL server login
 
Since this is a shared instance azure portal will check if the server name already exists. Once we see a green check beside the server name it indicates this is a valid server name which is avaiable for use. 
 
The admin credentials should be remembered and will be used to connect our SQL database outside of the azure portal using SQL management and azure portal.
 
In this example I am selecting location an Eastern US. We can select this as per the requirment from other avaiable locations.
 
Elastic Pool
 
Elastic pools provide a simple and cost-effective solution for managing the performance of multiple databases within a fixed budget. An elastic pool provides compute (eDTUs) and storage resources that are shared among all the databases it contains. Databases within a pool only use the resources they need, when they need them, within configurable limits. The price of a pool is based only on the amount of resources configured and is independent of the number of databases it contains.
 
Specify the elastic pool configuration as the per requirment.
 
Since this a demo I  am specifying elastic pool to No
 
Compute storage for database 
 
We can configure compute and storage for our database using configure database option.
 
We can customize cores, data storage and zone redudancy under this configuration. 
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
New and existing Azure SQL Databases and elastic pools that use the general purpose tier can enable zone redundant configuration, now in preview.
 
This feature utilizes Azure Availability Zones to replicate databases across multiple physical locations within an Azure region. By selecting zone redundancy, you can make your general purpose databases and elastic pools resilient to a much larger set of failures, including catastrophic datacenter outages, without any changes of the application logic.
 
Networking 
 
In this section we will configure access privileges for the datasbase.
 
For the demo I am configuring public end point and adding current ip address to server firewall.
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
This will allow us to access SQL database public outside of Azure portal using SQL management.
 
Under additional settings we can specify if any predefined datasource is required or not.
 
If a database needs to be created from a back up copy it can be specifed under additional settings.
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
Collation and Azure defender.
 
We have option to go for advanced vulnerability.
 
We will get periodic assessments. 
 
We'll start as free and need to pay a specified amount
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
Tags are used for grouping of resources for billing --  I am not using it for the demo.
 
Review final settings with estimated cost per month.
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
We can also download the template for automation if we want to create multiple databases.
 
Deployment might take sometime for sql database and server and we will receive notification.
 
Go back to home and under SQL server we can see our new database created.
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
Firewall settings 

It is the way of controlling. We can be allowed network access to your online resources on azure like SQL server.
 
It is better to have static ip to manage fire wall rules.
 
If we don’t have static ip we would manually need to maintain firewall rules.
 
Setting firewall rules for our SQL server
 
Navigate to our SQL SERVERS.
 
Select our newly created SQL server.
 
 Navaigate to show firewall settings. 
 
Creating Your First Azure SQL Database And Configure Firewall Settings
 
We can also specify IP ranges or ip adress as per the  requirement.
 

Summary

 
In this article, we have learned how to create, configure, and deploy our first Azure SQl database.
 
We have also seen how to configure firewall settings to access database outside of azure portal. 
 
In the next article we will see how to access this database outside of azure portal.
 
Thanks a lot for reading. I hope you liked this article. Please share your valuable suggestions and feedback. Write in the comment box in case you have any questions. Have a good day!