次の方法で共有


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:

https://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.

Comments

  • Anonymous
    August 27, 2015
    The comment has been removed

  • Anonymous
    August 31, 2015
    @Scott - thanks for the note!  Maybe I'll publish content for YouTube one day, for now I prefer writing to my blog.

  • Anonymous
    December 17, 2015
    Why only AdventureWorksLT and not the "fully fledged" version? Even Northwind is more complex. So I guess, moving AdventureWorks to azure is still a manual job :-(

  • Anonymous
    April 27, 2016
    Excellent... I am just now "playing" with Azure using BizSpark... I found your article helpful. Thank you!-------------------------Perry