Create an Azure SQL Database

This tutorial guides you through the process of creating a new Azure SQL Database using the Azure portal. This is a fundamental step for any application that requires a managed relational database in the cloud.

Prerequisites

Before you begin, ensure you have the following:

Steps to Create an Azure SQL Database

1. Sign in to the Azure Portal

Open your web browser and navigate to the Azure portal. Sign in with your Azure account credentials.

Azure Portal Login Screen

2. Navigate to SQL Databases

In the Azure portal search bar at the top, type "SQL databases" and select "SQL databases" from the search results.

Alternatively, you can click the menu icon (three horizontal lines) in the top-left corner, then select "Databases" and "SQL databases".

Azure Portal SQL Databases Search

3. Create a New SQL Database

On the "SQL databases" page, click the "+ Create" button.

Azure Portal Create SQL Database Button

Basic Settings

  1. Subscription: Select your Azure subscription.
  2. Resource group: Choose an existing resource group or create a new one by clicking "Create new". A resource group is a logical container for your Azure resources.
  3. Database name: Enter a unique name for your SQL database (e.g., MyApplicationDB).
  4. Server:
    • If you have an existing SQL server, select it from the dropdown.
    • If not, click "Create new".

    Creating a new server:

    • Server name: Enter a globally unique server name (e.g., myappserver123).
    • Location: Choose the Azure region where you want to deploy your server and database.
    • Administrator login: Enter a username for the server administrator.
    • Password: Enter a strong password for the administrator.
    • Click "OK" to create the server.

Workload Environment

Choose the environment that best suits your needs. For development and testing, "Development" is often sufficient. For production, consider "Production".

Compute + Storage

This is a crucial section for cost and performance. You can:

  • Select a pre-defined service tier (e.g., Basic, Standard, Premium) or configure a custom option.
  • For this tutorial, we'll select the "General Purpose" tier with a small compute size (e.g., Gen5, 2 vCore) and appropriate storage.
  • Click "Apply".
Tip: For development and testing, start with a smaller, less expensive configuration. You can always scale up later.

Networking

Configure network access. For simplicity, you can enable "Allow Azure services and resources to access this server". For more secure configurations, consider private endpoints.

Security

Review security settings. You can configure Azure Active Directory authentication here as well.

Additional settings

Explore options like data forms, collation, and read-scale replicas if needed.

Tags

Add tags to categorize your resources for better management.

Azure SQL Database Configuration

4. Review and Create

Once all settings are configured, click the "Review + create" button.

Azure will validate your configuration. If everything is correct, click "Create".

Azure SQL Database Review and Create

5. Deployment

The deployment process will begin. This usually takes a few minutes. You can monitor the deployment progress on the deployment page.

Azure SQL Database Deployment Progress

6. Access Your Database

Once the deployment is complete, click "Go to resource" to navigate to your newly created Azure SQL Database overview page. From here, you can find connection strings, configure firewall rules, and manage your database.

Note: Remember to configure firewall rules on your SQL server to allow connections from your IP address or specific networks.
Azure SQL Database Overview Page

Next Steps

Congratulations! You have successfully created an Azure SQL Database. Here are some things you can do next:

Important: Keep your server administrator credentials secure. Do not share them unnecessarily.