Create an Azure SQL Database with built-in sample data

Join me as I look at how you can create an Azure SQL database with built-in sample data!

Create an Azure SQL Database with built-in sample data

I was recently building some demo environments for a presentation and needed to have a SQL server in the mix.  But I as I was building the SQL server within Azure I realised I need to find some sample data to populate it with so I could have an accurate picture of solution and not just be an empty database.

Through the build process I noticed there was a new option when building the database there was a new setting talking about data source and one of the options was to use sample data(!) that would be deployed with the new SQL database.  So let's take a look at deploying a Azure SQL database with built-in sample data!

Let's build

The first step in the process is to select the Azure SQL deployment within the Azure Portal.  You'll be presented with three options:

Azure SQL deployment options

For this purpose, I selected a single database within SQL databases.

The next screen asks you the bases, the subscription you want to use, the resource group, database name and size.

Azure SQL deployment basics

Once you've filled in those details you'll be asked to start to configure the networking settings. And after that you will be asked about security, in this case if you want to enable Azure Defender for SQL.

Once you get through those steps the next step is around the data  and database collation.

Azure SQL data deployment

You can choose to deploy an empty database or you can use data from a backup that you have from another SQL server within Azure.

Or, and this is the option that excited me as deploy sample data without any additional steps.  The deployment will put data from that famous AdventureWorksLT source I'm sure we've all used at some point or see within tutorials before.

I selected this option and completed my deployment making sure I applied Tags to my deployment.

After the deployment had completed, I was able to connect to the database via Visual Studio Code and query the data. 😊

SQL query within Visual Studio Code

I love this, being able to deploy this and get sample data within the deployment saves me a couple extra steps.

Go on give it a go! 😊