Introduction

Azure SQL Database is a fully managed Platform as a Service (PaaS) database engine that handles most database management functions such as upgrading, patching, backups, and provides high availability without administrator involvement. This tutorial will guide you through the process of setting up a new Azure SQL Database from scratch using the Azure portal.

Prerequisites

Before you begin, ensure you have the following:

Step 1: Navigate to Azure SQL Databases

Sign in to the Azure portal

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

Search for SQL databases

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

Azure Portal Search
Create a new SQL database

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

Step 2: Configure Basic Settings

Server details

You'll need to create or select an existing SQL server. If you don't have one, click "Create new" next to the Server dropdown.

  • Server name: Enter a globally unique name for your SQL server.
  • Location: Choose the Azure region closest to your users or applications.
  • Administrator login: Create a username for the server administrator.
  • Password: Set a strong password for the administrator login.

Click "OK" to create the server.

Database details
  • Database name: Enter a name for your database (e.g., MyAwesomeDatabase).
  • Resource group: Select an existing resource group or create a new one to organize your Azure resources.

Step 3: Configure Compute and Storage

This section determines the performance and cost of your database. For testing and development, the "Serverless" tier is often a cost-effective choice.

Compute + storage

Click on "Configure database" in the Compute + storage section.

  • Service Tier: Select a tier like "General Purpose", "Business Critical", or "Hyperscale". For a first-time setup, "General Purpose" with a serverless option might be suitable.
  • Hardware configuration: Choose the vCore or DTU model based on your needs.
  • Max data size: Set the maximum storage size for your database.

Review the estimated cost and click "Apply".

Tip: The Serverless compute tier automatically scales compute based on workload demand and bills for compute used, pausing compute when not in use, which can save costs for development and test workloads.

Step 4: Network and Security Settings

Security

Under the "Security" tab, you can configure:

  • Microsoft Defender for SQL: Recommended for enhanced security.
  • Allow Azure services and resources to access this server: Enable this if you plan to connect from other Azure services.
  • Firewall rules: Define rules to control access to your server. You can add your current client IP address for immediate access.
Connectivity method

Choose your desired connectivity method. For most scenarios, "Default" or "Public endpoint" is used.

Step 5: Additional Settings (Optional)

Explore other tabs like "Additional settings" for advanced configurations like data encryption, collation, and backup storage redundancy.

Step 6: Review and Create

Review + create

On the "Review + create" tab, Azure will validate your configuration. If validation passes, you will see a summary of your settings. Click "Create" to deploy your Azure SQL Database.

Step 7: Deployment and Access

Deployment

The deployment process may take a few minutes. You can monitor the progress in the Azure portal.

Access your database

Once deployed, navigate to your SQL database resource. You will find the server name, database name, and connection strings. You can use these connection strings with tools like SQL Server Management Studio (SSMS) or Azure Data Studio to connect and manage your database.

Server Name: your-server-name.database.windows.net
Database Name: MyAwesomeDatabase
Admin Login: your-admin-username

Conclusion

Congratulations! You have successfully set up your Azure SQL Database. You can now start creating tables, inserting data, and building your applications on this robust and scalable cloud database.