Create an Azure SQL Database
This tutorial walks you through creating a new Azure SQL Database using the Azure portal.
Prerequisites
- An active Azure subscription.
- Permission to create resources in a resource group.
Step 1 – Sign in to the Azure portal
Open https://portal.azure.com and sign in with your Azure account.
Step 2 – Create a new SQL Database
- In the left navigation pane, select Create a resource → Databases → SQL Database.
- On the Basics tab, fill in the following fields:
- Subscription: Choose your subscription.
- Resource group: Select an existing group or create a new one.
- Database name:
mySampleDB - Server: Click Create new and provide a server name, admin login, password, and location.
- Compute + storage: Choose the appropriate pricing tier (the default Basic tier is fine for a test).
- Leave the remaining settings at their defaults and click Review + create.
- After validation passes, click Create. The deployment may take a few minutes.
Step 3 – Verify the deployment
When deployment succeeds, click Go to resource. You should see the overview page for your new database.
Optional: Create a table using Query Editor
Azure provides a built‑in query editor for quick testing.
- From the database's overview page, select Query editor (preview) in the left menu.
- Log in with the server admin credentials.
- Run the following T‑SQL script to create a sample table:
CREATE TABLE dbo.Products (
ProductID INT IDENTITY(1,1) PRIMARY KEY,
ProductName NVARCHAR(100) NOT NULL,
Price MONEY NOT NULL,
CreatedDate DATETIME2 DEFAULT SYSDATETIME()
);
After executing the script, you can query the table:
SELECT TOP 10 * FROM dbo.Products;