References: https://azure.microsoft.com/en-us/pricing/details/devops/azure-devops-services/
page_type: sample languages:
- nodejs
- javascript products:
- azure
- azure-app-service description: "This sample demonstrates a tiny Hello World Node.js app for Azure App Service."
The following image illustrates the CI/CD pipeline for deploying the Node.js application on Azure App Service.
This project provides a minimal Node.js application that can be deployed on Azure App Service Web App. It is useful for understanding the basics of deploying a Node.js application to the cloud using Azure CLI.
Before getting started, ensure you have the following:
- Node.js (v16 or later) - Download Here
- Azure CLI - Install Guide
- Git - Download Here
- An Azure Account - Sign up for Free
- Visual Studio Code (Optional but recommended) - Download Here
📖 Azure DevOps Node.js Tutorial
az account list-locations --query "[].{Name: name, DisplayName: displayName}" --output table
az configure --defaults location=westus2
resourceSuffix=$RANDOM
webName="helloworld-nodejs-${resourceSuffix}"
rgName='hello-world-nodejs-rg'
planName='helloworld-nodejs-plan'
az group create --name $rgName
az appservice plan create --name $planName --resource-group $rgName --sku B1 --is-linux
az webapp create --name $webName --resource-group $rgName --plan $planName --runtime "node|16-lts"
az webapp list --resource-group $rgName --query "[].{hostName: defaultHostName, state: state}" --output table
az group delete --name hello-world-nodejs-rg
If you encounter an error like:
'az' is not recognized as an internal or external command
- Ensure that Azure CLI is installed correctly.
- Restart your terminal or command prompt.
- Run
az --version
to check if Azure CLI is accessible.
- Confirm that your resource group and App Service plan exist using:
az group list --output table az appservice plan list --output table
- Ensure the correct Node.js runtime version is specified (
node|16-lts
). - Restart the web app:
az webapp restart --name $webName --resource-group $rgName
- Check deployment logs:
az webapp log tail --name $webName --resource-group $rgName
- Verify that the correct port is used (Azure Web Apps use port 8080 by default).
👤 Atul Kamble
Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request.
Happy Coding! 🚀