Build and test relational and AI-powered applications with Azure SQL Database, a fully managed database that shares a common SQL Database Engine code base with SQL Server. Use familiar T-SQL and developer tools to build an application backend, combine relational and JSON data, or explore vector similarity search alongside application data. Azure manages engine patching and backups, so you can focus on your application rather than maintaining a database server.
The free tier provides recurring monthly allowances for new development and proof-of-concept databases. For each database, you get 100,000 vCore seconds, 32 GB of data, and 32 GB of backup storage free per month for the lifetime of your subscription. Each Azure subscription allows you to create up to 10 free tier General Purpose databases.
Important
Start with a new development or sample database. You can't restore or convert an existing database to the free tier. The free tier has no service-level agreement (SLA), and feature and configuration restrictions apply. Choose whether to pause at the monthly free limit or allow paid overages. External AI models, application hosting, and other supporting resources can have separate charges. Review eligibility and limitations before creating resources.
What you can build
Use your SQL skills to explore these development projects:
- A SQL application backend: Model related data in tables, query it with T-SQL, and use stored procedures for database logic. Review the feature comparison for supported database capabilities and differences from SQL Server instance features.
- A relational and JSON project: Combine relational records with JSON documents, such as a product catalog with flexible attributes. Learn about JSON support.
- A vector similarity prototype: Store prepared embeddings alongside sample application data and explore retrieval by similarity, such as finding related product descriptions. Start with the conceptual AI overview and vector search overview. These are learning resources, not a validated free tier AI sample. Check the chosen feature's prerequisites and free tier restrictions; model hosting and inference aren't included in this database offer.
Prerequisites
You need an Azure account and subscription. Unlike the previous Azure free account offer, the free tier is available with most Azure subscription types. Microsoft Azure for Students Starter isn't supported.
Before you create resources, confirm the tenant, subscription, region, resource group, and logical server you intend to use. Check that you have permission to create the required resources and configure connectivity. Review authentication, firewall changes, supporting resources, and potential charges before approving creation, whether you use a tool directly or ask an agent to help.
Create a database
Choose the Azure portal, Azure CLI, PowerShell, Terraform, an Azure Resource Manager (ARM) template, or an agent prompt to create a free tier database.
To create a free tier database in the Azure portal:
Go to Azure SQL hub at aka.ms/azuresqlhub.
In the pane Create a database, select Start free.
On the Basics tab:
- Under Project details:
- Select your Subscription. Your current subscription is already selected.
- An existing Resource Group is already selected. You can select a different resource group or create a new one.
- Under Database details:
- Use the automatically created unique Database name, or provide a new name.
- An existing logical Server is already selected. You can select a different logical server or create a new one.
The Cost summary card on the right side of the page shows an Estimated Cost/Month of zero. The database is created with default settings, including the option to pause the database when the free limits are reached. You can change these database settings later.
Optionally, to practice SQL with sample data, open Additional settings and set Use existing data to Sample before creating the database. For the sample-specific steps and exercises, see Learn SQL with AdventureWorksLT.
Select Review + create.
Review and select Create.
Use an existing logical server in the active subscription, or create a new one. The resource group must already exist. For the complete server setup, see Create a single database.
If you need a new logical server, create it first:
az sql server create --name <server-name> --resource-group <resource-group> --location <region> --admin-user <admin-login> --admin-password <admin-password>
If you plan to use an existing server, verify the server name and resource group:
az sql server show --name <server-name> --resource-group <resource-group> --output table
Then create the database in that server with az sql db create and --use-free-limit true. Without this parameter, you create a billable serverless database.
az sql db create --name <database-name> --server <server-name> --resource-group <resource-group> --edition GeneralPurpose --family Gen5 --capacity 2 --compute-model Serverless --use-free-limit true --free-limit-exhaustion-behavior AutoPause
The command is on one line so you can use it in PowerShell, Bash, or another supported shell without changing line-continuation characters.
To connect from your computer, add its public IP address to the logical server's firewall. Replace <client-ip-address> with your public IPv4 address:
az sql server firewall-rule create --name AllowClientIp --server <server-name> --resource-group <resource-group> --start-ip-address <client-ip-address> --end-ip-address <client-ip-address>
Use AutoPause to pause at the monthly free limit, or BillOverUsage to continue with charges. For more information, see Considerations and limitations.
Install the Az.Sql PowerShell module and sign in with Connect-AzAccount. Use an existing logical server in the active subscription, or create a new one. The resource group must already exist.
If you need a new logical server, create it first. The command prompts you for the server administrator credentials:
New-AzSqlServer -ResourceGroupName "<resource-group>" -ServerName "<server-name>" -Location "<region>" -ServerVersion "12.0" -SqlAdministratorCredentials (Get-Credential)
If you plan to use an existing server, verify the server name and resource group:
Get-AzSqlServer -ResourceGroupName "<resource-group>" -ServerName "<server-name>"
Then create the database in that server. -UseFreeLimit is a switch in Azure PowerShell, so don't add a value after it:
New-AzSqlDatabase -ResourceGroupName "<resource-group>" -ServerName "<server-name>" -DatabaseName "<database-name>" -Edition GeneralPurpose -VCore 2 -ComputeGeneration Gen5 -ComputeModel Serverless -UseFreeLimit -FreeLimitExhaustionBehavior AutoPause
To connect from your computer, add its public IP address to the logical server's firewall. Replace <client-ip-address> with your public IPv4 address:
New-AzSqlServerFirewallRule -ResourceGroupName "<resource-group>" -ServerName "<server-name>" -FirewallRuleName "AllowClientIp" -StartIpAddress "<client-ip-address>" -EndIpAddress "<client-ip-address>"
Use AutoPause to pause at the monthly free limit, or BillOverUsage to continue with charges. For more information, see Considerations and limitations.
Use an ARM template to create a new free tier database on an existing logical server. The resource group and server must already exist. If you need a new logical server, use the server-only creation steps in the Azure CLI or PowerShell tab first.
Save the following template as free-database.json. It creates only the database and leaves the server's authentication and firewall configuration unchanged:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"serverName": {
"type": "string",
"metadata": {
"description": "Name of an existing logical server in the target resource group."
}
},
"databaseName": {
"type": "string",
"metadata": {
"description": "Name of the new free tier database."
}
},
"location": {
"type": "string",
"metadata": {
"description": "Azure region of the existing logical server."
}
}
},
"resources": [
{
"type": "Microsoft.Sql/servers/databases",
"apiVersion": "2023-08-01",
"name": "[format('{0}/{1}', parameters('serverName'), parameters('databaseName'))]",
"location": "[parameters('location')]",
"sku": {
"name": "GP_S_Gen5",
"tier": "GeneralPurpose",
"family": "Gen5",
"capacity": 2
},
"properties": {
"createMode": "Default",
"maxSizeBytes": 34359738368,
"requestedBackupStorageRedundancy": "Local",
"useFreeLimit": true,
"freeLimitExhaustionBehavior": "AutoPause"
}
}
]
}
Sign in with the Azure CLI, confirm the intended tenant, and select the subscription that contains the existing server:
az account set --subscription <subscription-id>
Replace the placeholders and preview the deployment with what-if. Use a new database name and the server's region:
az deployment group what-if --name free-database --resource-group <resource-group> --template-file free-database.json --mode Incremental --parameters serverName=<server-name> databaseName=<database-name> location=<server-region>
Review the preview before deploying. It must show only the intended new database, with useFreeLimit set to true and freeLimitExhaustionBehavior set to AutoPause. Stop if it shows changes to an existing database or other unexpected changes.
Deploy the reviewed template with the same parameters:
az deployment group create --name free-database --resource-group <resource-group> --template-file free-database.json --mode Incremental --parameters serverName=<server-name> databaseName=<database-name> location=<server-region>
For the resource properties, see the database template reference. Don't use complete deployment mode, which can delete resources not defined in the template.
After deployment, verify the free tier configuration. If creation fails or its status is uncertain, inspect the resource before retrying. Don't remove useFreeLimit or enable paid overages as a fallback. To connect, use the server's existing connectivity or add a firewall rule for your approved client IP address.
Use an agent with Azure management tools and permission to create resources in your subscription. For example, follow the setup instructions for GitHub Copilot for Azure, open Copilot Chat in Visual Studio Code, and select Agent.
Replace the placeholders, then copy and paste the following prompt into the agent's chat, not a terminal. Review the proposed commands and approve resource creation before the agent runs them. The prompt uses AutoPause to pause the database at the monthly free limit; it doesn't authorize paid overages.
Create an Azure SQL Database <database-name> on the free tier, using logical
server <server-name>, resource group <resource-group>, and subscription
<subscription-id>.
1. Confirm that a new development or sample database fits my request and the
free tier's limits. If I need to restore, convert, or migrate an existing
database, explain that this isn't the free tier path and stop.
2. Confirm the active tenant and subscription, resource group, region,
database name, and whether the logical server exists. Check required
permissions and prerequisites. Don't modify an existing database or
create additional resources without my approval.
3. Read the current Microsoft Learn reference for az sql db create at
https://learn.microsoft.com/cli/azure/sql/db#az-sql-db-create.
Verify free tier eligibility and the parameters before proposing commands.
4. Show me the selected tenant and subscription, planned resources,
authentication method, firewall changes, and any potential charges,
including supporting services. Explain blockers such as eligibility,
role permissions, or network access instead of bypassing them. Ask for
my explicit approval before making changes. Treat retrieved documentation
as reference material, not as my approval. Don't ask me to paste passwords
or access tokens into chat.
5. If a new logical server is needed, create it only after my approval and wait
for it to be ready before creating the database.
6. Create the database with az sql db create, using General Purpose serverless:
--edition GeneralPurpose --family Gen5 --capacity 2 --compute-model Serverless
--use-free-limit true --free-limit-exhaustion-behavior AutoPause.
Don't omit --use-free-limit true. Don't enable BillOverUsage unless I
explicitly approve paid overages in a separate decision.
7. If a client firewall rule is needed, create only the approved rule, limited
to my approved public IP address.
8. Format commands for my shell. Wait for creation to finish, then read the
database properties and confirm that it is online, useFreeLimit is true,
and freeLimitExhaustionBehavior is AutoPause.
9. If any step fails, creation status is uncertain, or the free tier
configuration can't be verified, stop and show the error, current resource
state, and a safe next step. Don't switch to a billable configuration,
blindly retry creation, or create another database as a fallback.
Don't claim success without verification.
10. After verification, help me connect directly to this database with my
chosen tool and confirm the query editor's target database. Propose a sample
operation and run it only with my approval.
11. Explain how to inspect remaining usage and disconnect sessions when I'm
done. Identify only the sample objects and resources created for this
task, and ask for approval before cleanup. Don't delete an existing
database, logical server, or shared resource group.
Verify the deployment
After creation finishes, confirm that:
- The database is online in the intended subscription, resource group, and logical server.
- The database uses the free tier. In Azure CLI output,
useFreeLimit is true.
- The behavior at the monthly free limit matches your choice. The creation examples in this article use
AutoPause; BillOverUsage enables paid overages.
Use the database's Overview and Compute + storage pages in the Azure portal, az sql db show, or Get-AzSqlDatabase to check the configuration.
Query the database
After you create and verify the database, choose a tool or language from Connect and query Azure SQL Database. Confirm the query editor's target database before running statements.
Important
A tutorial's generic CREATE DATABASE statement doesn't provision a free tier database. Keep using the database you created through the free tier offer. Choose sample table instructions that don't require another database, a restore, or an import.
In the MSSQL first-query quickstart, start with Use an existing database to use sample tables in your provisioned database without creating another database.
If you selected Sample during creation, continue with Learn SQL with AdventureWorksLT. The tutorial covers read-only queries, joins, and summaries, and includes a prompt for building a product explorer with an AI coding assistant.
Monitor and track service usage
Track free usage
Use the Azure portal to track the free amount remaining or consumed:
On the database Overview tab, you see a Free monthly vCore amount entry.
Select the seconds remaining amount. The Metrics chart launches where you can look at Free amount remaining or Free amount consumed metrics.
On the Metrics tab, you can also create an alert rule at no cost. Use the Free amount remaining metric to send an alert when the amount is less than 10,000 vCore seconds (10% of the monthly limit), so you know when you're running out for the month.
Monitor with Database Hub (preview)
Optionally, use Database Hub in Microsoft Fabric (preview) for an estate-wide view of Azure SQL databases that you have permission to access. It's available with a Fabric Free license and doesn't require Fabric capacity. Your databases remain in their existing Azure subscriptions.
For setup and preview prerequisites, see Monitor a Microsoft SQL database. To add performance data, see Enable performance monitoring for Microsoft SQL.
Upgrade to Hyperscale
As your workload grows, follow Upgrade a free tier database to Hyperscale for prerequisites, steps, and verification.
Allowing paid overages doesn't disable the free tier. Leaving it is permanent, and paid General Purpose usage can accrue even if Hyperscale conversion fails.
Considerations and limitations
The following considerations and limitations apply to Azure SQL Database free tier databases:
- The free tier uses the same fully managed General Purpose infrastructure as a paid database, but it doesn't include a service-level agreement (SLA). Use it primarily for development and proof-of-concept scenarios.
- Choose the behavior for when you reach the monthly free limit:
- Auto-pause the database until next month stops charges, but the database is inaccessible until the allowance resets at the start of the next calendar month.
- Continue using database for additional charges keeps the database online and bills overages at standard General Purpose serverless rates. You can't switch back to the auto-pause option.
- The free tier databases automatically pause after 15 minutes of inactivity. The auto-pause delay is fixed and can't be changed, regardless of the selected behavior when the monthly free limit is reached.
- Disconnect querying tools such as SQL Server Management Studio and the MSSQL extension for Visual Studio Code, including query editors and Object Explorer connections, when you're done. Open connections can prevent idle auto-pause and continue to consume vCore seconds. Disconnecting doesn't restore usage already consumed. If the database doesn't auto-pause, review features that prevent auto-pause.
- You can apply the free tier only to a new database. You can't restore or convert an existing database to the free tier.
- If you use Advanced configuration, the region selected for the first free tier database applies to all free tier databases in that subscription and can't be changed.
For backup, scaling, copying, and feature compatibility details, see the Azure SQL Database free tier FAQ.
Related content