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.
- Navigate to the Azure portal.
- In the search bar, type "SQL databases" and select it.
- Click "Create".
- On the "Basics" tab, select your subscription, resource group, provide a server name, administrator username, and password.
- Configure other settings like location and version as needed.
- 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.
- Once the server is deployed, go to the server resource.
- In the server overview page, click "+ Create database".
- Provide a database name.
- You can choose to use the existing server or create a new one if you skipped the previous step.
- Select a compute and storage configuration. For quickstarts, the "Basic" tier is often sufficient.
- 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):
- Download and install SQL Server Management Studio (SSMS) if you haven't already.
- Open SSMS and in the "Connect to Server" dialog, enter your server name (e.g.,
your-server-name.database.windows.net
). - For "Authentication", choose "SQL Server Authentication".
- Enter the administrator username and password you created in Step 1.
- Click "Connect".
- 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.
- In the Azure portal, navigate to your SQL Database server.
- Under "Security", click "Firewalls and virtual networks".
- Click "Add client IP" to add your current IP address to the allowed list.
- You can also specify custom IP address ranges.
- Click "Save".
Next Steps
- Learn more about optimizing performance.
- Explore security features.
- Discover development tools.