Create an Azure SQL database with the free offer
In this task you'll create an Azure SQL database.
Azure SQL Database is Microsoft's SQL Server database engine, run for you. Backups, patching and high availability are built in, so you only look after your tables, data and queries.
Every database lives on a logical server, which holds the sign-in settings and firewall rules for its databases. Azure offers a free SQL database offer: a small serverless database with a monthly allowance of compute and storage, for as long as the subscription exists.
Example. SS Kaiser keeps its online stock levels in an Azure SQL database. Nobody at SS Kaiser patches or backs up a server any more; they just query the data.
Before you start
You need: Contributor on the resource group. Time: 15 minutes.
Where to look
- Home
- SQL databases
- + Create
Steps
- Open SQL databases and select + Create. If a banner offers the free Azure SQL Database offer, select Apply offer.The offer covers 100,000 vCore seconds, 32 GB of data and 32 GB of backup storage each month. Check the cost summary on the right shows it.
- Choose rg-portal-practice and name the database db-practice.
- Next to Server, select Create new. Give it a unique name such as sql-portal plus your initials, and your region.
- For authentication, choose Microsoft Entra-only authentication and set yourself as the admin.No SQL passwords to manage: you sign in with your own Entra account.
- Select OK. Under the free offer, set what happens when the monthly allowance runs out to auto-pause the database until next month.The other choice keeps it running and charges you, which you don't want for practice.
- On Networking, choose a public endpoint and set Add current client IP address to Yes.This adds a firewall rule for your own address, so you can query it from the portal.
- Select Review + create, check the cost shows the free offer, then Create.
Tip. Look for the banner offering the free Azure SQL Database offer at the top of the Create page.
Commands
# A server that only accepts Entra sign-in, with you as admin
az sql server create --resource-group rg-portal-practice --name sql-portal-<initials> \
--location uksouth --enable-ad-only-auth \
--external-admin-principal-type User --external-admin-name <your sign-in name> \
--external-admin-sid $(az ad signed-in-user show --query id --output tsv)
# A serverless database using the free offer, pausing when the allowance runs out
az sql db create --resource-group rg-portal-practice --server sql-portal-<initials> \
--name db-practice --edition GeneralPurpose --compute-model Serverless \
--family Gen5 --capacity 2 \
--use-free-limit --free-limit-exhaustion-behavior AutoPause
Watch out for
- Cost
- Inside the free offer's monthly allowance the database costs nothing, as long as it's set to auto-pause when the allowance runs out. Other sizes and copies of the database are billed normally.
- Security
- Use Entra-only authentication where you can. Keep firewall rules tight: allowing all Azure services, or wide address ranges, lets far more in than you need.
- Common mistakes
- Missing the free offer banner and creating a paid database. Choosing to continue when the allowance runs out. Forgetting the server name must be unique across Azure.
Clean up
- Resource groups
- rg-portal-practice
- Delete resource group
Keep the database for the next two tasks, then delete the resource group at the end of this section. That removes the server and every database on it.
Words to know
- Logical server
- A container for databases that holds their sign-in and firewall settings. It isn't a VM you can log in to.
- Serverless
- A compute option that scales with load and pauses when idle, so you pay only for the seconds it works.
- vCore
- A virtual processor core, used to size and price the database.
Tick off each step and track your progress in the guide.
Open this task in Azure Portal, Hands On