Finally Got My Database into Azure!

I’m very pleased to say that I’ve finally gotten my local SQL Server database into Azure SQL!! The MSDN article that really helped was using this one titled SQL Server database migration to SQL Database in the cloud. This article lists various ways in which you can migrate you SQL Server database into Azure. (Note: it also references other types of databases.)

One of these methods was to use SQL Server Data Tools (SSDT), which I’ve got experience at using, so I decided on that one. The link to SSDT led me to a page titled Migrate a SQL Server Database to Azure SQL Database Using SQL Server Data Tools for Visual Studio. I found this to be very helpful!

Following the instructions on that last link I created a project in Visual Studio (using SSDT) to detect SQL Database V12 Incompatibilities. I had some V12 incompatibles (really, no surprise), but again following that last link’s instructions I eliminated the incompatibles.

Next I published my (slightly modified) database schema and data into Azure. At this point I created a new database and published it there. It asked me to create the firewall rules (this is where I specified my IP address). I’ve got it up there and have looked at the data through Visual Studio.

Learning Azure SQL

Recently I decided that I wanted to stretch myself by learning some new technologies. The “cloud” has been around for a few years now, but I haven’t yet used it, at least from a developer’s point of view. So I’ve decided to start with Microsoft’s Azure. I’m going to chronicle my learning experience here, if for no other reason than I’ll have something to refer to in the future. Smile

Since I’m doing this on my own, mostly on the weekends and whenever I can sneak in 30 minutes some weekday evening, I’ve had to ask around to learn how to do it. It was recommended to me that I take something I’ve used in the past and upload it to Azure. Years ago I started a SQL Server database at home, so that I could learn new (to me at least) technologies. (I used this to help me learn ASP.NET and WPF/XAML.) This database is for our fairly extensive DVD (and now Blu-ray) collection. I called it MediaLibrary.

The first thing I had to decided was how to get my MediaLibrary into Azure. I asked around and got two suggestions. First, I could create a VM in Azure, install SQL Server into it and upload my database into it. (What I believe is called Platform as a service, or PAAS.) This idea attracted me at first, but others suggested that doing this I really wouldn’t learn anything new. They recommended that I learn Azure SQL instead. (Infrastructure as a service, or IAAS.) So that’s the approach I’ve decided to follow.

A Useful Tutorial on Getting Started with Azure SQL

The first big help I got was to go to a link for a tutorial on how to do this, titled SQL Database tutorial: Create a SQL database in minutes using the Azure portal. I’m finding this to be a very helpful tutorial so I highly recommend it.

Single IP vs. Range of IP Addresses

Being a novice at this there are some obstacles I’ve run into. I read through the tutorial before starting. The first thing I ran into right away was where it said, “Create a server-level firewall rule for a single IP address or for a range of IP addresses.” Again I asked about this and was told that either I could get a static IP address or I could ask my ISP for the range of IP addresses they have. I thought that my ISP would have a huge range of IP addresses and I certainly didn’t want someone else potentially getting to my database in Azure, so I’ve decided to get a static IP address from my ISP. If you’re following this blog post, you have to make your own decision in regards to this. For myself I thought the static IP would work best.

Next Steps

Next I created a new SQL Server (logical server). As I understand it now, this is a place where a Azure SQL database can be put. You need this first before you can go on. When I entered all of the information required (see the link above to the tutorial) it took about 5 minutes to create after I clicked the Create button.

Next I went to create the Azure SQL database itself. This is as far as I’ve gotten. I’m now at the section titled, “Create a new Azure SQL database”. Where I’ve gotten stuck is selecting the source. The Select source dropdown has three options: Blank, Sample or Backup. I don’t want a blank database, as I’ve already got one. I don’t want a sample like AdventureWorks. Really the best choice for me is Backup, because I’ve backed up my MediaLibrary database. However this is where I’ve gotten stuck; selecting Backup makes Azure look only at itself for the backup. At least that’s the idea I’ve gotten. It certainly doesn’t give me the option to upload my .bak file. So, until I learn what I’m supposed to do next, I’m stuck. Hopefully I’ll learn later today. I’ll post after that.