Using Azure, you can create a SQL Database in just a few seconds without having to worry about setting up the infrastructure or any related software. Additionally, Azure SQL databases allow you to connect using your preferred operating system, and programming language such as ADO.NET, Java, PHP, Node.js, Python, and Ruby.
You can easily create an SQL Database on Azure by following the steps below:
- Open your Azure portal and click on ‘Create a resource’
- Select SQL Database from the options
- The portal will provide you with a screen to enter details regarding the database to be created.
- Enter the database name
- Select the subscription you would like to use for this database (Microsoft allows you to have multiple subscriptions under one user)
- Choose an existing resource group or create new resource group for this database to be a part of. (An Azure Resource Group is a way to group a set of resources together so that you can manage permissions, set alerts, develop deployment templates etc.)
- Select a source for the database – blank database, sample data set from Microsoft (good old AdventureWorks), or backup that you may have created previously.
- Select Server and create a new server. Select a location for your server to be hosted. This can be based on where the majority of your transactions are going to be from.
- Choose if you want to use SQL Elastic Pool (Adding a database to an elastic pool will allow that database to scale when there is a need. An elastic pool provides compute (eDTUs) and storage resources that are shared between all the databases it contains. Databases within a particular pool only use additional resources when they need them while making sure they don’t go over the limits specified by the user. This way elastic pools provide a simple and cost-effective solution for managing the performance of a database within a fixed budget.)
- Finally, select a Pricing tier for the database. Pricing is based on how many DTUs you expect your database to use. DTU stands for Database Transaction Unit, compute sizes for Azure databases are expressed in terms of DTUs for single databases and elasticDTUs (eDTUs) for elastic pools. To read more about DTU based Service Tiers read this.
- Database collation defines the rules that sort and compare data. Collations provide the locale, code page, sort order and character sensitivity rules for character-based type data. Azure currently supports 3800 database collations.
- Click on Create.
- Azure will start working on the deployment.
- You will receive a notification once the deployment is complete
Working with the newly created SQL DB:
You can click on ‘Go to Resource’ option within the notification to open the SQL database instance you just created.
There are a load of options you can play with on this screen. Two major options I would like to highlight are:
- Connect with Visual Studio: You can click on this option and open the database in your local Visual Studio to work on it.
- Geo-Replication: You can use this option to replicate your database across geographical locations if you have users accessing the database from multiple countries.
You can also delete the database you previously created from this screen by clicking on the ‘Delete’ option.