DEV Community

Cover image for Create a virtual machine with SQL
Tolulope Adeleke
Tolulope Adeleke

Posted on

Create a virtual machine with SQL

Hello there! Happy New year 2022 as this is my first post this year.

We are creating a virtual machine but with SQL. So make sure you have downloaded SQL Server management studio(SSMS) on your local computer before we get started.

We will make use of Microsoft Azure( as our Cloud Provider)

In the Azure Portal navigate to SQL virtual machines.

Image description

Click Create SQL virtual machines.

Now go to the Image select, SQL Server 2019 on Windows Server

Image description

Click Create and enter the following information:
Resource Group: Create a new resource group and call it Database Servers with the following settings:
Now create a new server with this: mssql01(yourlastname)
Virtual machine name: MSSQL01
Availability options: No infrastructure redundancy required
Image: (default)
Size: Standard_DS1_V2(1 vcpu, 3.5 GB of memory)

It should look exactly like this

Image description

  **Username**: sqladmin
  **Password**: (meets the requirements)
   **Public inbound ports**: Allow selected ports
  ** Select inbound ports**: RDP (3389)
Enter fullscreen mode Exit fullscreen mode

STOP... Do not click check box for use existing license

Image description

Navigate to the SQL Server settings tab at the top and enter the following information:
SQL Authentication: Enable
Login name: dbadmin
Password: (Make sure this meet the requirements)
SQL Server License: No
Automated backup: Disable

It will appear like this;

Image description

After Validation, Click create

Image description

Create and wait for deployment

Image description

Deployment is complete...Yaayyy

Image description

Click on 'Go to resource'... You will see a page that looks just like this

Image description
Click on Connect>RDP and click Download RDP File.

Image description

Image description

Copy the AdventureWorksLT2019.bak file into the Temporary Storage drive.

Connect to the VM and login with the username and password you created in Step 3.

Image description

Image description

After connection, you will be navigated to a page that looks like this;

Image description

Image description

On your local machine search and navigate to_ Microsoft SQL Server Management Studio_ and click Connect

In the window, enter the following settings:

     **Server type**: Database Engine
     **Server name**: (you created in Step 3)
     **Authentication**: SQL Server Authentication
     Login and Password: (you created in Step 4)
Enter fullscreen mode Exit fullscreen mode

Click Connect

Now, make sure to right click on Databases and select Restore database

Image description

Image description
Click on the circle/radio button to the left of device then proceed to Click on the 3 dots to the right of Device and the field.

Image description

Image description

In the new window, click add and navigate then select the AdventureWorksLT2019.bak.

Make sure to follow the setup leaving everything as default until you get the following message:

               Database 'AdventureWorksLT2019' restored successfully.
Enter fullscreen mode Exit fullscreen mode

Great work so far ! As a beginner, this is an essential part of your learning Journey that you just achieved, kudos.

Image description

Top comments (0)