T-SQL Tuesday #82–Azure SQL Database

tsqltuesdayIt’s T-SQL Tuesday time and this month we have Jeffrey Verheul giving us the topic of the cloud, or Azure SQL Database. It’s a good topic, given how many people are talking about working in the cloud. There are also the tremendous resources that Microsoft is investing in Azure, so cloud database posts are a good thought for this month.

Whether you are writing today (Sept 13) or at some point in the future, it’s fun and informative to participate in the T-SQL Tuesday blog party. Learn something and write about it.

Azure SQL Database

I have done a little work with Azure SQL Database, but not a log. I have a few ideas, but finding time and focusing has been a challenge. When I saw this topic I had all sorts of ideas, but since I was traveling and busy, I ended up arriving at the deadline without any work done.

However, there was one thing I’ve been wanting to try in Azure, so I decided to make this the post. I wanted to create an Azure SQL Database using Powershell. This is a topic that I think lends itself to better orchestration and development, so here goes.

The first step was a quick Google search, which led me to this post on how to Manage Azure SQL Database with Powershell. That’s what I really wanted to do, so I read a bit. The first step was to download the latest Azure Powershell. I did that and ran an install. This required a reboot, something I rarely like, but I swallowed my annoyance and restarted the desktop.

Once that was done, I ran a couple cmdlets to get connected and check what resources I had. First, I had a login prompt.

2016-09-13 14_10_50-Windows PowerShell credential request

Then I got results. As you can see, I had a few, and the list actually scrolls down quite far.

2016-09-13 14_23_23-powershell

I then tested another cmdlet, Get-AzureRMResourceProvider, to get a list of regions.

2016-09-13 14_25_22-powershell

That worked, so let’s create a database. I used the New-AzureRMSqlDatabase cmdlet, which worked well. I provided the resource group name and servername I already had with a new database.

2016-09-13 14_14_44-powershell

That completed, and things looked good. I connected to the Portal, and sure enough, I had a new database.

2016-09-13 14_15_23-dkranchapps - Microsoft Azure

Of course, an S1 will eat up all my credits, so I changed that right away.

2016-09-13 14_15_57-TSQLTuesday - Microsoft Azure

That was pretty easy. I can see how I might now string together the creation of a database with some other work, perhaps adding data, certainly using the Redgate DLM Automation or ReadyRoll scripts to create objects, and then I can run things and tear them down.

Speaking of which.

2016-09-13 14_32_24-powershell

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , . Bookmark the permalink.

1 Response to T-SQL Tuesday #82–Azure SQL Database

  1. Pingback: More Azure Database Creation in Powershell | Voice of the DBA

Comments are closed.