Introduction
This article will try to understand Azure SQL Database service and 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 the SQL server outside the Azure portal using SQL management and Azure Studio
Step by step to create and configure SQL Server database in Azure
Navigate to the Azure portal using https://portal.azure.com/ and select SQL database from the left
Click on add under SQL database.
This will now open the below pop-up
Configure a new SQL server instance
Select your subscription type.
If you have an existing resource group, select the resource group or create a new one.
Specify a valid database name and select the server name where this database needs to create.
If you don't have an existing server, create a new one by clicking the create a new button.
Specify your server name and configure admin user credentials for SQL server login.
Since this is a shared instance, the azure portal will check if the server name exists. Once we see a green check beside the server name, it indicates this is a valid server name that is available for use.
The admin credentials should be remembered and used to connect our SQL database outside of the azure portal using SQL management and Azure portal.
In this example, I am selecting a location in the Eastern US. We can select this as per the requirement from other available 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 shared among all the databases it contains. The price of a pool is based only on the number of resources configured and is independent of the number of databases it contains. Databases within a pool only use the resources they need, when they need them, within configurable limits.
Specify the elastic pool configuration as per requirement.
Since this a demo, I am specifying an 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 redundancy under this configuration.
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 much larger failures, including catastrophic data center outages, without any changes to the application logic.
Networking
In this section, we will configure access privileges for the database.
I am configuring a public endpoint for the demo and adding the current IP address to the server firewall.
This will allow us to publicly access the SQL database outside the Azure portal using SQL management.
Under additional settings, we can specify whether any predefined data source is required.
If a database needs to be created from a backup copy, it can be specified under additional settings.
Collation and Azure defender.
We have the option to go for advanced vulnerability.
We will get periodic assessments.
We'll start as free and need to pay a specified amount
Tags are used for grouping resources for billing -- I am not using them for the demo.
Review final settings with an estimated cost per month.
We can also download the template for automation if we want to create multiple databases.
Deployment might take time for the SQL database and server, and we will receive a notification.
Go back home, and we can see our new database created under the SQL server.
Firewall settings
It is a 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 firewall rules.
We would manually need to maintain firewall rules if we don't have static IP.
Setting firewall rules for our SQL server
Please navigate to our SQL SERVERS.
Select our newly created SQL server.
Navigate to show firewall settings.
We can also specify IP ranges or IP addresses as per the requirement.
Summary
This article taught us how to create, configure, and deploy our first Azure SQL database. We have also seen how to configure firewall settings to access databases outside the Azure portal.
In the next article, we will see how to access this database outside the 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!