Kirk Evans Blog

.NET From a Markup Perspective

Adventure Works for Azure SQL Database

This post will show how to create the Adventure Works sample in an Azure SQL Database using the new Azure portal.

Background

Every once in awhile, I will need a sample database to test something out.  Such was the case today, I wanted to use the Adventure Works database sample in Azure SQL Database.  However, I remembered that there were a few modifications required to make it work in Azure SQL Database, so I kept searching to find a blog post somewhere that said how to do this.  I kept running into a download page:

http://msftdbprodsamples.codeplex.com/releases/view/37304

I am lazy in my old age, and I wanted something easier. 

I’ll also admit that I don’t use the new Azure portal very often, I prefer the old blue portal.  I decided to check to see if there is a link or quickstart… even better, they added Adventure Works directly into the blade!

This may be old news to some of you, but I couldn’t find this anywhere and it’s worth mentioning.

Create the Database

Click the New button and choose New / Data + Storage / SQL Database.

image

The blade asks you to create a server.  Provide a name, location, and choose if you want to use the latest version (if your region supports it). 

image

On the “Select Source” option, choose Sample.

image

Now the samples are shown, and you can choose which one.  I am using a V12 server, so I’ll choose the V12 database.

image

Choose your pricing tier.  This is just a quick demo of Azure Search and I don’t need active geo-replication for this solution, so I can get away with the $4.99US per month option.

image

Review all of your settings and create the database.

image

Yes, it’s that easy.  In about 10 minutes, my shiny new Adventure Works database is ready.

Playing Around With Azure SQL Database

I now go into Visual Studio 2013 and refresh the SQL Databases node, and the AdventureWorks database is there.

image

Right-click and open in SQL Server Object Explorer.

image

You are prompted to add a firewall rule.

image

Provide credentials, and you are now logged in and can easily query the database.

image

Like I said, probably old information for some, but I was happy to see that I didn’t have to go edit indexes in SQL scripts anymore just to get a sample database going. 

Notably missing: Northwind.  Gotta get Northwind up there Smile

For More Information

Adventure Works for Azure SQL Database – download the database and install from command line instead of using the portal integration shown above.