Deploying a Nodejs application to Azure using Azure App Service

Mouad Lasri
3 min readDec 31, 2019

Prior to becoming a Microsoft Student Ambassador, I was not using any of the Microsoft technologies to develop or deploy my application. I was mainly using JavaScript from Front-end to Back-end, namely Reactjs, and Nodejs (with Expressjs). Most of my past applications were developed using those technologies.

However, becoming an MSP gave me the opportunity (and the chance!) to explore new horizons with new and exciting technologies. Before diving deeper in new programming languages and frameworks, I needed to first learn how to deploy my previous applications using a Microsoft technology: Azure.

There are probably many people in the same situation as me, i.e. transitioning from their old tools to Microsoft technologies. And this is the reason why my contribution is to show how to deploy a simple Nodejs to Azure using Azure App Service.

Microsoft Azure is a cloud computing service created by Microsoft for building, testing, deploying, and managing applications and services through Microsoft-managed data centers (Source: Microsoft Azure website).

Pre-requisites:

Now, the next step is to Sign to your Azure Account, click on the Azure icon, then sign in

As I said previously, this tutorial assumes you already have a Nodejs application ready to be deployed. If it is not the case, check out the Visual Studio Code tutorial on how to create a Nodejs application at this link: https://code.visualstudio.com/tutorials/app-service-extension/create-app

Alright! Let’s get started on deploying our Nodejs app. I will be using one of my basic apps that I developed some time ago. It uses Express framework and EJS (Embedded JavaScript) templates as a view engine.

In the Azure App Service explorer, click on the blue arrow pointing to the top ‘Deploy to Web App..’

Give a name to your Web application:

Choose your Nodejs version from the list

The application will take some time to be deployed. Also, make sure your application listen to the port provided by the PORT environment (shown below in my application).

Once the deployment completes, click Browse Website in the prompt to view your freshly deployed website. In the Azure App Service explorer, you can also check the details about your application, such as connections, the applications settings, logs…

Congratulations! You have deployed your Nodejs app using Azure.

Further details about the application can be seen on your Azure portal at portal.azure.com

For any questions, please feel free to ask them in the comments section.

--

--