DEV Community

Cover image for Connecting a Node Js app to Azure MS-SQL server. Part 1
emmilly immaculate
emmilly immaculate

Posted on

Connecting a Node Js app to Azure MS-SQL server. Part 1

Azure

So after learning alot about the azure databases options in my cloud school,i wanted to create something cool with them.

Being a developer, i decided to try connecting a nodejs application to a MSSQL database.

So my goal was to see data from my on website.Preferably in a table like this.
table data

First i had to set up an SQL Database in Azure which i will focus on in this part.

Second i had to create a nodejs application.I decided to use express.js, typescript and ejs.
Project Structure

So to get started setting up an SQL database,
Step 1: Search for SQL Database
Search

Step 2: Tap the create button at the far left.
Tap create

Step 3: Next select a resource group to manages all your resources for the service.

Resource group

Step 4: Now it is time to add a database name and create or choose an SQL server to run the database on.

Choose server

Step 5: Creating a server involves giving a name and choosing the authentication option to log into it.
Make sure to keep the credentials for later.

Server

Step 6: Next select the backup option
Choose server

Step 7: Next we are choosing the network options as below to allow us to connect to the server.
network

Step 8: Next we can leave these as defaults and move to security

defaults

Step 9: Next we shall choose to use a sample database.

Choose sample

Step 10: Click the create button
Create

Next we shall open microsoft Azure Studio and connect to to the created Database in Part2.

Top comments (0)