Get Started with Azure SQL Database

This quickstart guide will walk you through the basic steps to create and connect to an Azure SQL Database.

Step 1: Create an Azure SQL Database Server

First, you need to create an Azure SQL Database server. This server will host your databases.

  1. Navigate to the Azure portal.
  2. In the search bar, type "SQL databases" and select it.
  3. Click "Create".
  4. On the "Basics" tab, select your subscription, resource group, provide a server name, administrator username, and password.
  5. Configure other settings like location and version as needed.
  6. Click "Review + create" and then "Create" to provision your server.

Step 2: Create a SQL Database

Now, create a database within the server you just provisioned.

  1. Once the server is deployed, go to the server resource.
  2. In the server overview page, click "+ Create database".
  3. Provide a database name.
  4. You can choose to use the existing server or create a new one if you skipped the previous step.
  5. Select a compute and storage configuration. For quickstarts, the "Basic" tier is often sufficient.
  6. Click "Review + create" and then "Create".

Step 3: Connect to Your Database

You can connect to your Azure SQL Database using various tools. Here's an example using SQL Server Management Studio (SSMS):

  1. Download and install SQL Server Management Studio (SSMS) if you haven't already.
  2. Open SSMS and in the "Connect to Server" dialog, enter your server name (e.g., your-server-name.database.windows.net).
  3. For "Authentication", choose "SQL Server Authentication".
  4. Enter the administrator username and password you created in Step 1.
  5. Click "Connect".
  6. Once connected, you can right-click on your database and select "New Query" to start executing SQL commands.

Alternatively, you can use Azure Data Studio or programmatically via various SDKs and connection strings.

Step 4: Configure Firewall Rules

To allow connections from your IP address or specific ranges, you need to configure firewall rules.

  1. In the Azure portal, navigate to your SQL Database server.
  2. Under "Security", click "Firewalls and virtual networks".
  3. Click "Add client IP" to add your current IP address to the allowed list.
  4. You can also specify custom IP address ranges.
  5. Click "Save".

Next Steps

View More Azure SQL Database Documentation