This quick tutorial shows you how to build a simple Node.js application and deploy it to the Azure App Service, from the command-line. The steps in this tutorial can be followed on any operating system that can run Node.js.
Prerequisites
Create Node.js web app
-
Open the command-line terminal and install the Yeoman Express generator.
npm install -g generator-express
|
-
Within a working directory, generate an express app.
-
Choose the following options:
Would you like to create a new directory for your project? Yes
Enter directory name: <appname>
Select a version to install: MVC
Select a view engine to use: Jade
Select a css preprocessor to use (Sass Requires Ruby): None
Select a database to use: None
Select a build tool to use: Grunt
|
-
CD into the root of your new app. We’ll want to make sure it runs in your development environment.
Within your browser, go to http://localhost:3000. You should see the Express home page. We now have a simple running Node.js web app using Express.
Deploy to Azure App Service
Now that you’ve verified the app runs correctly, type Crtl+c in the command terminal to stop it.
-
Enter the following commands to change into ASM Mode and log in to Azure.
azure config mode asm
azure login
|
Use the prompt to login through the browser with your Microsoft account.
-
Within the root directory of your application, create the App Service app resource in Azure using the following command.
azure site create --git <appname>
|
Follow the prompt to create Git/FTP deployment credentials, if you never set them up before.
-
Use git to deploy your app to Azure.
git add.
git commit -m “<your commit message>”
git push azure master
|
-
Lastly, launch your live Azure app in the browser with the following command.
You now have a very simple Node.js web app running live in Azure App Service.

The Azure App Service is a fully managed platform for web, mobile, and integration scenarios. Although this tutorial is a pretty basic example, it shows how easy it is to build and deploy a Node.js web app to Azure App Service.
