With Microsoft’s Azure cloud services platform, learn how creating new SQL databases is a straightforward process of filling in a few details about what you want.
- [Instructor] With Microsoft Azure cloud services platform, creating new SQL databases is a straightforward process of filling in a few details about what we want. To get started, log into your account at portal.azure.com. That'll start you off on the main dashboard view for your account, which you can see on my screen here. In the center of the screen are tiles that'll act as shortcuts to various areas within Azure, and this is customizable for each user, so yours is going to look a little bit different from mine. As we add services, you'll see additional tiles appear on the screen in your dashboard.
Now, at any time, if you want to customize the dashboard, go ahead and click on the Edit dashboard button at the top of the screen. Then, you can click on each individual tile and either move it around or resize it as you like. When you're done, press the Done customizing button to return back into your dashboard. Now, some of the services that are available inside of Azure can be accessed from the icons on the left side of your screen. If you press on the button here at the top, we can show the text labels so we can see what the icons correspond to. There's a couple of different ways that we can create a new Azure SQL database.
The first option is to press on the green plus icon for new. That'll open up a listing of templates that we can add from the Azure Marketplace. Go ahead and click on the Databases section, and then in the Featured group, we can find SQL Database. If you click on the text SQL Database, that'll open up a new window, what are called blades here inside of Microsoft Azure, and then it'll give you a description of the template. You can either choose to create it from here, or press the X button in the upper right-hand corner to close the blade. That'll return us to the Azure Marketplace where I can simply press the Create button here to get started.
So that's one way to get started creating a SQL database. Let's go ahead and close this blade and return back into our dashboard. The other way is to come over here to the SQL databases section of the left-hand menu. That'll show us a listing of all of the existing SQL databases that we have on our system. In this case, I don't have any right now. I could either press the Add button in the upper left-hand corner, or press the blue Create SQL databases button to get back to that configuration window. So as you can see, there's multiple routes to setting up a new Azure SQL database.
To create our database, we need to fill in all of the required details on this window, as indicated by the red asterisks. First, we need to supply a new database name. I'll type in the name KinetEcoDB. Notice the green check mark that shows up to the right. Sometimes Azure requires names to be unique for your account, and sometimes names will need to be unique globally, meaning that nobody else has used the same name. Azure will check the availability of names that you type in, and if they're acceptable, it'll put a green check mark here, so that you know that we're good to go.
The next thing we need to choose is the subscription. Go ahead and choose either the free trial, or I'm on a pay-as-you-go account, so I'll go ahead and choose that. Next up is the resource group, which is a collection of computer resources that we will use for this database. Now, we don't yet have an existing resource group, so we can go ahead and create a new one here by choosing the Create new option and giving it a name. I'll go ahead and call it KinetEcoRG. Next up is the database source. We have three options in this drop-down menu. We can either choose to start with a blank database, that'll be a new empty database that we can work with, we can preload a database with sample data from the AdventureWorksLT database, or we can restore a database from an existing backup.
I'll choose the blank database option, and go ahead and click off of that. Next, we need to configure the server, and it has quite a few settings to configure, so when you click on this, it'll open up a new blade. Since we don't have any existing servers set up, it actually automatically selects the Create a new server option, and then opened up the New server configuration blade. Here, we'll give the server a name. The server name needs to be globally unique, so common names will likely already be taken by other Azure users. A common approach to naming servers is to prepend the name with a consistent prefix, such as your initials or the name of your company.
I'll go ahead and type in aw-kineteco. If you see the green check mark, that means you're good to go, otherwise, go ahead and type in a different server name. Next, we need to type in a name for the server administrator. I'll go ahead and just type in my name, Adam. Then, we need to supply a password of at least eight characters. This password needs to have uppercase, lowercase, and numeric or special characters involved. When you've typed in an acceptable password, and confirmed that password with a matching password, you'll get the two check marks there.
Finally, we need to choose a location for our server. The location will physically house our server's resources in one of Microsoft's data centers around the world. Now, it makes sense to choose the location nearest you, so I'll go ahead and choose West US. I'll press the Select button at the bottom of the screen, and that'll apply my settings for the server configuration over back into my SQL database setup. Next up is the option to configure an elastic pool of resources. We'll talk about what that means later on in this chapter, so for now, just go ahead and choose Not now.
The next option is the pricing tier. Let's go ahead and click on that to open it up in a new blade. This screen has lots of details that talks about something called DTUs and storage requirements. I'll cover all of this in a separate movie in this chapter, since there's a lot here. So for now, just go ahead and click on the Basic section on the left side of the screen, and then press Apply. I'll scroll down in my SQL database configuration window here, and we'll see that we have one final step, and that's to set the collation. The default collation is case insensitive and accent sensitive.
Now, this isn't a drop-down menu, so if you wanted to choose a different collation method, which controls how the database will sort and compare values, then you need to type in a full and valid string in this box. I'll go ahead and just leave the default value. At the very bottom of the configuration blade, we have a check mark that'll create a tile on the dashboard for easy access, if we'd like. I'll go ahead and turn that on, and then finally, press the Create button. That'll begin the process of deploying my new Azure SQL database.
This process is going to take a few minutes, and it's going to return us to the dashboard to wait. You'll also notice a scrolling icon here in the Notification button that you can keep your eye on. When the deployment's complete, you'll get this notification message pop-up, and it takes us to the database's overview screen. Here, we can see the resource group that we created, and it's called KinetEcoRG, the status is online, location is West US, and so on. We can also scroll down on the screen to see the monitoring graph for the DTU consumptions for this database, and if we scroll down further, we have some performance recommendations as well as threat detection.
Let's go ahead and scroll back up. I'm going to go ahead and close this window by pressing the X in the upper right-hand corner of the screen, and that'll return us to our dashboard where we can see this new tile has been created. To see the resource group that was created, go over to the menu on the left side of the screen and click on Resource groups. That'll show us all of the resource groups that we have in our Azure subscription, and I just have the one. If I click on KinetEcoRG, that'll show me what's inside of it. We have a single SQL server instance called aw-kineteco, and inside of that, we have a single SQL database called KinetEcoDB.
All of these names are links which will take you back and forth through the services that you've configured. So for instance, if I click on KinetEcoDB, that'll take us back to the overview screen for that particular database. Once again, I'll go ahead and close that to return back. We can also get to the database by clicking the SQL database button, which is represented by this cylinder icon. When I click on it, it'll show me a listing of all of the SQL databases that I have, and once again, there's the KinetEcoDB that we created. Now, in order to delete a database, go ahead and find it in the SQL databases window, and then go over to the button on the far right with the three dots or the ellipsis.
I'll click on it, that'll bring up a new menu, and I can press the Delete button. Here, I need to confirm that I want to delete the database. I'll go ahead and press Yes, and that'll begin the process of deleting the database. I also want to go ahead and delete the resource group that we created. So once again, I'll return to the resource group section. I'll find the resource group that I want to delete, the KinetEcoRG, I'll come over to that ellipsis button on the right, and once again, I'll click on it, and then choose delete. This time I have one additional step. I need to type in the name of the resource group to confirm that it's the one that I want to delete.
So I'll type in the name KinetEcoRG. Once the typed in name matches the name of the resource group that I want to delete, that'll become active, and then I can press the Delete button. Once again, I'll get a notification here saying that that delete is in process. I'll go ahead and close this window by pressing the red X in the background. If at any time you want to review your notifications, just click on the bell icon, and that'll show you the last notifications that you've received. Here, I can see that I successfully deployed the database at 1:33 p.m., I deleted it at 1:36 p.m., and the resource group deletion is currently still in progress.
Let's go ahead and clear all of these by clicking the All button, and then close this notification window. So now we've gone ahead and successfully created and removed our first Azure SQL databases and the resource groups that held it.
This course is also ideal for anybody preparing for the Provisioning SQL Databases (70-765) exam, one of two exams necessary to earn an MCSA: SQL 2016 Database Administration certification.
- Deploying a Microsoft Azure SQL Database
- Planning for a SQL Server installation
- Planning for an IaaS or on-premises deployment
- Evaluating best practices for installation
- Provisioning an Azure virtual machine
- Deploying SQL Server using templates
- Managing SQL Server instances
- Migrating SQL Server databases to Azure VM
- Migrating client applications