Azure SQL Database Tutorial

Learn to create and manage your SQL databases in the cloud.

Step 1: Create an Azure SQL Database

This tutorial will guide you through the process of creating a new Azure SQL Database using the Azure portal. This is the foundational step for storing and managing your relational data in Azure.

Prerequisites: An active Azure subscription. If you don't have one, you can create a free account.

Accessing the Azure Portal

First, navigate to the Azure portal and sign in with your Azure account credentials.

Azure Portal Login

Once logged in, you'll see your Azure dashboard.

Creating a New SQL Database

To create a new SQL database, follow these steps:

Step 1: Navigate to SQL Databases

In the Azure portal search bar, type "SQL databases" and select it from the results. Alternatively, you can find it under "Azure services".

Search for SQL Databases

Step 2: Initiate Database Creation

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

Create SQL Database Button

Step 3: Configure Basic Settings

You will be presented with the "Create SQL database" form. Fill in the required fields:

  • Subscription: Select your Azure subscription.
  • Resource group: Choose an existing resource group or create a new one. A resource group is a logical container for your Azure resources.
  • Database name: Enter a unique name for your database (e.g., MySampleAzureDB).
  • Server: You need an Azure SQL server to host your database. You can either select an existing server or create a new one.

To create a new server:

  1. Click Create new under the Server dropdown.
  2. Enter a Server name (must be globally unique).
  3. Provide an Administrator username and Password. Remember these credentials as they will be used to connect to your SQL server.
  4. Select the Location for your server.
  5. Click OK.
SQL Database Basic Settings

Step 4: Configure Compute and Storage

In the "Compute + storage" section, configure the performance and cost of your database. You can choose from predefined configurations or use the "Configure database" option for more granular control.

  • Service tier: Select a tier that suits your performance and cost requirements (e.g., General Purpose, Business Critical, Basic).
  • Hardware configuration: Choose the number of virtual cores and memory.
  • Max data size: Set the maximum storage capacity for your database.

For this tutorial, we'll use the default settings or a cost-effective option like the "Basic" tier for demonstration purposes.

SQL Database Compute and Storage

Step 5: Configure Networking and Security

Under the "Networking" tab, you can configure how your database is accessed. For initial setup, you can allow Azure services and resources to access this server. For enhanced security, consider configuring firewall rules later.

Under the "Security" tab, you can set up additional security features like transparent data encryption.

SQL Database Networking and Security

Step 6: Review and Create

Navigate to the "Review + create" tab. Azure will validate your configuration. Once validation passes, review the summary of your settings and click the Create button.

SQL Database Review and Create

Azure will now deploy your SQL database. This process may take a few minutes.

Deployment Complete: Once the deployment is finished, you'll see a notification. You can then navigate to your newly created SQL database.

Next Steps

Congratulations! You have successfully created an Azure SQL Database. In the next tutorial, we'll cover how to connect to your database and run basic queries.

Proceed to Connect to Your Database