How To Get a Free Azure SQL Database
Microsoft Azure offers a robust ecosystem for developers and IT professionals, and one of its standout opportunities is the free Azure SQL database. In his video on "How To Get a Free Azure SQL Database", Tim Corey demystifies the process, showing how to set up, manage, and connect to a cloud-based SQL Server using Azure—all at no cost.
In this article, we’ll take a closer look at Tim’s tutorial, section by section, using his instructions to guide us through every step.
Introduction and Context
Tim opens by pointing out that while Azure services include many free offers, people often don’t know how to take full advantage of them. This session is all about getting a SQL database free offer that is free forever under your Azure subscription, then using it the right way.
He notes that this is ideal for software engineers, students, or hobbyists exploring Azure, and that he’ll walk through everything from database creation to frontend connectivity using Visual Studio and a Blazor Web App.
Setting Up the Free SQL Database
Tim navigates to the Azure portal, clicks “Create a resource,” and selects “SQL Database.” On the create SQL database page, there’s an option to Try Azure SQL for free. This creates a serverless database with the following free tier limits:
100,000 vCore seconds
32 GB of data
32 GB of backup storage
- One SQL database per Azure subscription
Tim emphasizes that this offer is designed for learning, experimentation, and dev/test scenarios—not high-load production.
Configuring Project Details and Database Name
Tim names his resource group “free SQL”—an efficient way to group related resources in Azure. Each resource group name acts as a container, making it easier to clean up after testing. The database name is “demo DB,” and since there’s no existing database, Tim clicks “Create new server.”
He sets a server name as “timcoreydemo,” selects a region, and continues with setup.
Selecting the Authentication Method
When asked for an authentication method, Tim opts for SQL authentication, creating a server admin login with the username “Tim” and a secure password. He explains that Microsoft Entra authentication (formerly Active Directory) could be used for production, but SQL authentication is simpler for demonstration purposes and connection strings.
Reviewing the Cost Summary and Auto Pause Feature
Tim focuses on the cost summary card, which confirms that the SQL database will cost $0. He explains the auto pause mechanism: if you exceed the free amount—the allocated 100,000 vCore seconds or 32 GB of backup storage—the service will automatically shut down to avoid overages. It resets the next month, making it effectively a free Azure SQL database that’s free forever as long as you stay within the limits.
Finishing Deployment via the Create Button
Tim skips over optional settings like the networking tab, additional settings, and Microsoft Defender integration. He clicks through to “Review + Create” and begins the provisioning process. This takes a few minutes, during which the database is created and linked to the resource group and server.
Understanding Server vs. Database
After deployment, Tim highlights the distinction between a SQL Server (which hosts one or more databases) and the SQL database itself (where your actual data resides). While the server doesn’t incur a separate cost in this setup, the database does—unless it falls within the free tier limits.
He pins the database to the dashboard to make accessing it quicker.
Configuring Firewall Rules
Tim shows how to set up access to your Azure SQL database by modifying the firewall rule. From the server settings, he allows public endpoint access and adds his current client IP address. This allows him to connect from his local machine.
In a production setup, you might avoid public access and instead allow Azure services to connect directly, using internal network security.
Exploring the Query Editor
Inside the query editor, Tim logs in with his SQL authentication credentials and confirms that the database is still empty. No tables or procedures exist yet—it’s a blank slate ready for development.
Building the SQL Database Locally
Tim switches to Visual Studio and uses SQL Server Data Tools (SSDT) to create a local database schema. He installs the required tools—specifically the “Data storage and processing” workload via Visual Studio Installer.
He starts a new project using the SQL Server Database template, naming it “Demo DB,” and links it to the broader solution titled “Free Azure Demo.”
Designing a Person Table and Stored Procedure
Tim adds a table named Person, with three fields: ID (marked as Identity and primary key), FirstName, and LastName—both marked as nvarchar and required.
He then creates a stored procedure spPerson_GetAll that retrieves all rows from the Person table. He also uses the refactoring tool to replace SELECT * with explicitly named columns, promoting better query performance and stability.
Publishing the Schema to LocalDB
Tim attempts to publish the schema to LocalDB, which acts like a local SQL Server instance. He first hits an error due to a mismatch between target SQL versions—LocalDB emulates SQL Server 2019, but the project targets SQL Server 2022.
He resolves this by switching the target to Azure SQL Database under project properties and republishing. Success!
Adding Sample Data and Running Queries
Tim manually inserts test data—such as “Tim” and “Sue”—into the local DB through Visual Studio’s object explorer. This populates the Person table, providing data for the frontend later.
Creating a Blazor App to Connect
Tim builds a Blazor Server app named “DatabaseDemoApp” and adds it to his solution. He includes the necessary NuGet packages: Microsoft.Data.SqlClient and Dapper, and adds a custom class called SQLDataAccess.
Writing the Data Access Layer
In the SQLDataAccess class, Tim writes a generic method LoadData<T, U> using Dapper to query SQL using a stored procedure. He reads the connection string from the configuration file and ensures connections are properly disposed using the using statement.
Displaying SQL Data on the Web Page
Tim updates the Weather page to show the list of people from the database. He creates a PersonModel with the corresponding properties and binds it to a Razor table. This page pulls live data from SQL Server (initially LocalDB) using the LoadData method.
Connecting to Azure SQL Database
Next, Tim copies the Azure SQL connection string from the Azure portal. He walks through publishing the schema to the cloud via Visual Studio, targeting the Azure SQL database rather than LocalDB.
In the query editor, he inserts new records (“Tim Corey” and “Scooby Doo”) directly into the Azure SQL database.
Using User Secrets for Secure Configuration
To prevent hardcoding sensitive credentials, Tim uses User Secrets to store the connection string securely. He pastes the string into secrets.json and removes it from appsettings.json, keeping secrets out of source control—a best practice for professional developers.
Verifying Data Retrieval from the Cloud
Tim re-runs the app, and instead of loading local records, it now displays the entries from the Azure SQL database: Tim Corey and Scooby Doo. This proves that once properly configured, an Azure SQL database acts just like a local one.
Deleting the Resource Group to Clean Up
Tim emphasizes the importance of cleaning up to prevent lingering resources and accidental charges. He navigates to the resource group name, confirms the project details, and deletes the entire group—including the database, server, and related services.
Final Summary and Free Tools to Explore
Tim wraps up by encouraging viewers to explore free Azure tools like the Azure SQL Database Free offer. Whether you're learning or testing, this free database gives you a safe space to experiment and grow, with features like:
32 GB of backup storage
Free amount of vCore seconds
Integration with Visual Studio and Blazor apps
- Compatibility with real-world Azure services
He reminds viewers that this opportunity to create SQL databases without cost is invaluable for anyone diving into Azure, SQL, or cloud software engineering.
Conclusion
Tim Corey’s walkthrough of the free Azure SQL database setup is more than just a tutorial—it’s a practical masterclass on using cloud-based resources effectively and affordably. From creating the SQL database free offer to deploying a full Blazor app connected to a live Azure SQL instance, he breaks down the process with clarity and depth that’s rare in tech tutorials.
To get the complete experience, watch Tim Corey’s video. His channel is a treasure for developers, offering comprehensive lessons on topics like SQL Server, C#, Azure services, and more.
