By: Rajendra Gupta | Updated: 2024-07-31 | Comments (1) | Related: > Azure SQL Database
Problem
Would you like to have access to Azure SQL Database for free forever? If so, read this article to learn how Azure offers a free Azure SQL Database serverless configuration for a lifetime.
Solution
Azure offers a free-tier account to create, deploy, test, and manage applications with access to popular services for 12 months without charge. After the free account period, you need to switch to the Pay-As-You-Go (PAYG) model that charges you monthly for the product or service usage over the month. However, if you are looking to explore Azure SQL Database beyond the free tier, Azure has an offering for you.
Under this offering, Azure provides 100,000 vCore seconds of computing every month for the life of the subscription for the Azure SQL Database. It includes 32 GB of data and 32 GB of backup storage, free to use monthly. You can use this Azure SQL Database to learn, develop, and POC. To get this free Azure database, you must switch to a PAYG model in Azure, which applies to one database per Azure subscription.
Let's see how to create the free Azure SQL Database using the Azure portal.
Deploy Serverless Azure SQL Database
Search for the SQL databases after connecting to the Azure portal.
![Search for SQL databases](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-1.png)
Click Create SQL database on the search results page.
![Create SQL databases](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-2.png)
A banner appears on the Create SQL Database page: Want to try Azure SQL Database for free?
Click Apply offer (Preview) to utilize this free Azure SQL Database.
![Apply offer (Preview)](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-3.png)
Once the offer is applied, the banner will change (below).
![Offer applied](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-4.png)
Note: Do not click Remove offer if you want to use the Azure SQL Database freely within the defined limits.
Project Details
Choose the subscription from the drop-down.
Next, select a resource group to deploy the Azure SQL Database and its resources. If you do not have an existing resource group, click Create new and provide a resource group name. For this tip, I will provide a resource group named mssqltipsresourcegroup.
![Project details](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-5.png)
Database Details
Enter the database name. I specified the database name as mssqltipsazure.
![Database details](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-6.png)
Server Details
Click Create New Server and enter the following details:
- Server name: Enter the server name (e.g., demoserver1) and Azure appends the domain .database.windows.net.
- Location: Choose the Azure region where you want to deploy the Azure SQL Database.
- Authentication method:
You can choose to use either of the following:
- Use Microsoft Entra-only authentication (Azure Active Directory).
- Use both SQL and Microsoft Entra authentication.
- Use SQL authentication. Specify the server admin login (other than SA) and passwords.
Click OK.
![Server Details](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-7.png)
![Server details 2](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-8.png)
Behavior when the free offer limit is reached
As stated earlier, the offer is for 100,000 vCore seconds of computing and 32 GB maximum data size. If you exhaust the free-limit offering, you have two options.
- Auto-pause the database until next month: This is the default selection. Under this option, the Azure SQL Database will be paused and inaccessible for the remaining month. You can access the database at the beginning of the following calendar month.
- Continue using a database for additional charges: For this option, the database will be continuously accessible, and you will be charged for the additional vCore usage and storage as per your subscription billing method. It will follow the standard general-purpose tier for serverless billing rates.
![Behavior when free offer limit reached](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-9.png)
Let's use the default option - Auto pause the database until next month - and click Next.
Connectivity method
Choose the public endpoint for connecting to Azure SQL Database over the internet.
![](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-10.png)
For additional settings, choose the data source, database collation, and preferred maintenance window on the next page.
![Data source, database collation, maintenance window](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-11.png)
Data Source
You can restore an existing database from a backup or create a sample database.
Let's choose the sample and click OK on the following pop-up message. It will create a sample [AdventureWorksLT] database in the Azure SQL Database.
![AdventureWorks LT](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-12.png)
Product Pricing
In the Review + create page, notice the estimated Azure SQL Database cost.
![Review + create](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-13.png)
You can also view the details on the cost- summary page on the right side. As shown below, you get:
- First 32 GB storage free.
- First 100,000 vCore seconds free.
- Disabled overage billing using the option to Auto-pause the database until next month.
![Cost summary](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-14.png)
Review the Azure SQL Database configuration and click Create to deploy the General Purpose - Serverless: Standard-series (Gen5), 2 vCores, 32 GB storage with locally redundant backup storage, as shown below.
![Create SQL Database](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-15.png)
It starts the deployment and notifies you of the progress.
![Deployment progress](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-16.png)
Connecting
Click Go to resource after the deployment is complete and note down the server name.
![Deployment complete](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-17.png)
![database info](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-18.png)
Launch SQL Server Management Studio (SSMS) and enter the server name and credentials for SQL Server authentication.
![SQL Server authentication](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-19.png)
You might get the following connection failure due to the connection being denied public network access, which is set to Yes.
![connection failure](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-20.png)
To resolve this error, go to Azure SQL Server and click on the Networking tab.
Change public network access to Selected networks.
![Public access settings](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-21.png)
Add a firewall rule to allow specific public internet IP addresses to access the Azure SQL Database. Click + Add a firewall rule then enter the start and end IPv4 address range values.
![Firewall rules](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-22.png)
Click Save to update the server firewall rules.
![Updated](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-23.png)
Now, connect to Azure SQL Database in SSMS, and the connection goes through.
Select serverproperty('ProductVersion') as version, serverproperty('Edition') as edition
![connection](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-24.png)
Track and Manage the Free Monthly vCore Seconds
As we specified earlier, Azure offers 100,000 vCore seconds per month. Therefore, you must track and manage the resources effectively to utilize them for that period. Azure SQL Database serverless configuration automatically pauses the database when no open connections exist. Therefore, you can run the following query, check the connected sessions, and disconnect them when unused. Disconnecting the database connections from tools such as Azure Data Studio (ADS), SSMS, and Visual Studio is essential.
SELECT session_id, host_name, program_name, client_interface_name, login_name, status, login_time, last_request_start_time, last_request_end_time FROM sys.dm_exec_sessions AS s INNER JOIN sys.dm_resource_governor_workload_groups AS wg ON s.group_id = wg.group_id WHERE s.session_id <> @@SPID AND ( ( wg.name like 'UserPrimaryGroup.DB%' AND TRY_CAST(RIGHT(wg.name, LEN(wg.name) - LEN('UserPrimaryGroup.DB') - 2) AS int) = DB_ID() ) OR wg.name = 'DACGroup' );
![Check the connected sessions](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-25.png)
Also, once you log into the Azure portal, you can check the overview of the Azure SQL Database and see the remaining vCore seconds. As shown below, currently, I have 98.198 vCore seconds remaining. The status column also shows that the database is currently in a paused state.
![Overview - status](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-26.png)
If you want to check whether you are using the Azure SQL Database free offer, click on the feature tab, which shows that the offer is active.
![Offer status](/tipimages2/8048_get-azure-sql-database-serverless-free-lifetime-27.png)
Next Steps
- Deploy and start exploring the Azure SQL Database for free.
- You can review existing tips for Azure.
- Read FAQ for Azure SQL Database free for any questions.
About the author
![MSSQLTips author Rajendra Gupta](/images/Rajendra-Gupta-20220116.png)
This author pledges the content of this article is based on professional experience and not AI generated.
View all my tips
Article Last Updated: 2024-07-31