A hands-on lab using Microsoft Azure to create and configure a cloud-based SQL Database.
In this guide, you’ll deploy a fully managed SQL Database in Azure. You’ll create a resource group, configure a logical SQL server, set up a database, configure networking/firewall rules, and test connectivity from a client machine.
- Microsoft Azure (Portal + CLI optional)
- SQL Server Management Studio (SSMS) or Azure Data Studio
- Azure CLI (optional, for automation)
- macOS Sonoma (if you own MacBook Air M1 or M2; version doesn’t matter)
- Windows 10 or Windows 11 Home/Pro (if you own either of them)
- Go to Azure Portal
- In the left menu, click Resource Groups > Create
- Set:
- Name:
SQL-LaB
- Region: Closest to your location (e.g., East US)
- Name:
- Click Review + Create > Create
📌 Note: Always organize resources inside groups—it makes cleanup and management easier.
- In the Azure search bar, type SQL Server > Create
- Fill in:
- Name:
sqllab-server
- Region: Same as your resource group
- Admin login:
labadmin
- Password:
SQLlab123!
- Choose resource group:
SQL-Lab
- Name:
- Click Review + Create > Create
📌 Note: This “server” is logical, not physical—it hosts your SQL databases.
- In the Azure Portal, search for SQL Databases > Create
- Fill in:
- Database name:
DemoSQLDB
- Server: Select
sqllab-server
- Compute + Storage: Choose Basic (good for labs/testing)
- Networking: Keep defaults for now
- Click Review + Create > Create
📌 Note: Start small with compute/storage—you can scale up later.
- Go to
SQL-Lab
>DemoSQLDB
>Networking
- Under Firewall rules:
- Click + Add client IP (this adds your computer’s current IP)
- Save changes
- Ensure “Allow Azure services to access server” is ON
📌 Note: If you switch networks (home → coffee shop), you’ll need to update firewall rules.
- Open SQL Server Management Studio (SSMS) or Azure Data Studio
- Server name:
sqllab-server.database.windows.net
- Authentication: SQL Server Authentication
- Login:
labadmin
- Password:
SQLlab123!
- Login:
- Click Connect
✅ If successful, you’re connected to your cloud SQL Database.
CREATE TABLE Products ( ProductID INT PRIMARY KEY IDENTITY, Name NVARCHAR(100), Price DECIMAL(10,2)
);
INSERT INTO Products (Name, Price) VALUES ('Azure Coffee Mug', 9.99), ('Cloud Hoodie', 29.95);
SELECT * FROM Products;
📌 Note: You’ve just created and queried your first Azure-hosted table!
az group create --name SQL-Lab --location eastus
az sql server create \ --name sqllab-server \ --resource-group SQL-Lab \ --location eastus \ --admin-user labadmin \ --admin-password SQLlab123!
az sql db create \ --resource-group SQL-Lab \ --server sqllab-server \ --name DemoSQLDB \ --service-objective Basic
📌 Note: Azure CLI is great for automation and repeatable deployments.
You’ve successfully:
- Created a resource group and logical SQL server
- Deployed a cloud-based SQL Database
- Configured firewall rules for client access
- Connected via SSMS/Azure Data Studio
- Created and queried your first table