Create a virtual machine with SQL
Tags: beginners, azure, serverless, cloudskills
Published: 2022-01-14 14:46:04

**_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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fr8xh7e5xijrhu5vtpoj.PNG)

**Click Create SQL virtual machines**.

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k1ch2g19sdcv7nag4699.PNG)

 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86ssquwyb4r4pt3awfys.png)
 

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

   **_STOP_**... Do not click check box for use existing license


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ml49acku7hzurell2jmq.PNG)



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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vizlvtw8msmj9j2dk8v4.PNG)


**After Validation, Click create**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvtl7z820cnnlyxfqfh1.PNG)

**Create and wait for deployment**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0asijmsv1cbwaxevm0lq.PNG)

**_Deployment is complete...Yaayyy_**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tbb1bnvtjdpt8mb2o03g.PNG)

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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dtp6hg9smo1uevved39y.PNG)
**Click on _Connect>RDP_ and click _Download RDP File_.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5gj28b2yx7vpif8ed6c0.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vda6hhiz1kmrcgjyvjg.jpg)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gapm13ahykrj8nfmm6du.jpg)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lqu63w1hl4rvwtfr0efa.PNG)

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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0u8m9mek0o7xo2bkrdz.JPG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8il8n6vw3h3kckmkjja4.JPG)



**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)
 
Click **Connect**

_Now, make sure to **right click on Databases and select Restore database**_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mkfla31w0xr8m1731swd.JPG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g22g4u05oaox5c9iaxjn.JPG)
 **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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8cetgqfgyg5uwealzym.JPG)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2qwu5eiygb8gs5ojk5e.JPG)

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.





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




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hnp4ced9h0ymf58yp9xl.jpg)