Deployiong a Node Js app on Azure Cloud


Recently, I decided to explore Azure Cloud and its wide range of services. One of the first things I wanted to try was deploying a Node.js (Express) application on the cloud. I will be using the Azure CLI on Windows. You can also use the Azure portal manually, but I personally find that the CLI offers more detailed control over application deployment and is more developer-friendly.
Let me lay down the steps to below to get started on this, which is quite straigh forward:
- Crete an Azure account
You can link your gmail/github whih will be quite easy and dev friendly.
Get the free subscription for 30 days where Microsoft will grant you free credits to play around. No upfront charges are required just a Debit card is ncessary.
npx express-generator myExpressApp --view ejs
Set up express ap via express-generator
Modify the code of app.js
winget install --exact --id Microsoft.AzureCLI
Install the Azure cli using Powershell from windows
az login
Login to your azure account via this command
az account show
This shows your active subscription
Go to the directory of the express app you created and open up the path in vs code terminal/powershell
az webapp up --sku F1 --name node-azure-one --os-type Windows
Run this command; node-azure-one is the name of the resource group you’ll be prompted..os type should be windows. You can come up with any name
Once done it sould give the details of the uploaded url and status something like this below:
Test the url endpoints:
Once satisfied you can delete the resource group list from cli/from the Azure portal under you account resource group.
az group delete --name <resource-group-name>
This will help delete the resource group via cli.
In this way deploying a Node js app on the azure cloud becomes easy and feasible by making use of the Azure cli. In my future blogs i shall be covering up more of azure cloud’s services and also deploying and using a full stack mern application.
Subscribe to my newsletter
Read articles from Pratikshit Chowdhury directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
