Creating Azure resources or services in Azure Portal is relatively easy activity. But, many times we need to understand some concepts or services which involve data. So, who likes creating tables, primary key – foreign key relationship, preparing inserts statements for tables, stored procedures etc.? I think most of us would not like it. That’s the reason, Azure SQL can help up to some extent.
There are two ways to create AdventureWorks database to an Azure SQL. One while creating an Azure SQL and other one, add it a running Azure SQL instance. So, we will apply both the techniques.
Let’s consider you already have a resource group <demo>.
Create Azure SQL with AdventureWorks
Now, navigate to your resource group under your Azure subscription and perform steps as below –
- Click on Add
- Search and Select Azure SQL from search textbox
- Click on Create from service overview screen
- you will land on How do you plan to use the service?, here select SQL Database which would be first option.
- Click on Create
You will land on Create database screen, enter or select resource group, Database name and add Server Configuration. You can select Basic Azure SQL configuration for compute and storage.
You need an admin user for Azure SQL instance, so create it.
So, if you click on review and create (hold on) it will create Azure SQL Server with one database, but Adventure Works database will not be added. Hence, click on Additional Settings tab from the Use existing data option select Sample option. Now, click on Review and Create and wait for the Azure SQL to get deployed.
So, connect SQL Server using SSMS or Azure Data Studio with an admin user and password to verify tables.
Add AdventureWorks to Azure SQL running Instance
This is another scenario where you already have an Azure SQL instance and want to add AdventureWorks database. To do so, go to Azure SQL Overview screen from resource group and click on Create Database.
After this, provide new database name <AdventureWorks> as per the screenshot 1 and select Sample option as per the screenshot 2. Click on Review and Create, and wait for the deployment to complete.
Now, There will have two databases. if the Azure SQL Server is not connected, then connect it with an admin user and password.
Note : You need to allow client IP address in the Firewall Settings of Azure SQL Server to connect from SSMS or Azure Data Studio.
So, this would be helpful to kickoff Azure Data Factory, Webapp with Database, Entity framework, WebAPI, and Data Encryption etc.
Hope, you can utilize Azure SQL feature, whenever you come across mentioned scenarios.
If you have any suggestions/feedback, please put them in the comment box.
Happy Learning 🙂