Skip to content

cyreal06/Expres-Azure-SQL-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Azure SQL App

A simple Express.js API that connects to Azure SQL using Sequelize ORM.

Features

  • GET /api/hello: Returns a welcome message
  • POST /api/users: Creates a user (name & email)
  • GET /api/users: Retrieves all users

Tech Stack

  • Node.js
  • Express.js
  • Sequelize
  • Azure SQL

Getting Started

  1. Clone the repo:
git clone https://github.com/your-username/express-azure-sql-app.git
cd express-azure-sql-app
  1. Install dependencies:
npm install
  1. Create a .env file:
PORT=3000
DB_HOST=your-sql-server.database.windows.net
DB_NAME=your-database-name
DB_USER=your-db-username
DB_PASSWORD=your-db-password
DB_DIALECT=mssql
DB_PORT=1433
DB_ENCRYPT=true
  1. Run the app:
npm start
  1. Deploy to Azure:
  • Use Azure App Service (Node.js 18+)
  • Set environment variables in the Azure App Service configuration
  • Enable port binding by using process.env.PORT

Notes

  • Make sure your Azure SQL firewall allows the Azure App Service IP range.
  • Use sequelize.sync() for dev; for production, consider migrations.

About

App Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors