The Microsoft Azure environment is one of the very best to use to set up your database. In this short tutorial, you learn how to set up a single database. Get in touch if you have any questions or want to learn more about how to create your databases.
10 minutes to read, from our friends at Microsoft:
In this quickstart, you use the Azure portal, a PowerShell script, or an Azure CLI script to create a single database in Azure SQL Database. You then query the database using Query editor in the Azure portal.
A single database is the quickest and simplest option for Azure SQL Database. You manage a single database within a server, which is inside an Azure resource group in a specified Azure region. In this quickstart, you create a new resource group and server for the new database.
You can create a single database in the provisioned or serverless compute tier. A provisioned database is pre-allocated a fixed amount of compute resources, including CPU and memory, and uses one of two purchasing models. This quickstart creates a provisioned database using the vCore-based purchasing model, but you can also choose a DTU-based model.
The serverless compute tier is only available in the vCore-based purchasing model, and has an autoscaled range of compute resources, including CPU and memory. To create a single database in the serverless compute tier, see Create a serverless database.
- An active Azure subscription. If you don’t have one, create a free account.
Create a single database
In this step, you create a logical SQL server and a single database that uses AdventureWorksLT sample data. You can create the database by using Azure portal menus and screens, or by using an Azure CLI or PowerShell script in the Azure Cloud Shell.
All the methods include setting up a server-level firewall rule to allow the public IP address of the computer you’re using to access the server. For more information about creating server-level firewall rules, see Create a server-level firewall. You can also set database-level firewall rules. See Create a database-level firewall rule.
Query the database
Once your database is created, you can use the built-in Query editor in the Azure portal to connect to the database and query the data.
In the portal, search for and select SQL databases, and then select your database from the list.
On the SQL Database page for your database, select Query editor (preview) in the left menu.
Enter your server admin login information, and select OK.
Enter the following query in the Query editor pane.
SELECT TOP 20 pc.Name as CategoryName, p.name as ProductName FROM SalesLT.ProductCategory pc JOIN SalesLT.Product p ON pc.productcategoryid = p.productcategoryid;
Select Run, and then review the query results in the Results pane.
Close the Query editor page, and select OK when prompted to discard your unsaved edits.
Clean up resources
Keep the resource group, server, and single database to go on to the next steps, and learn how to connect and query your database with different methods.
When you’re finished using these resources, you can delete the resource group you created, which will also delete the server and single database within it.