Deploy to Azure App Service using the Azure CLI

In this tutorial, you deploy a Node.js application to Azure App Service using the Azure Command Line Interface (CLI), which runs on all operating systems. With the CLI you can create Azure resources, set up a deployment pipeline between a Git repository and Azure, and view the app's console.log output.


You can alternately use the Azure CLI extension for Visual Studio Code, which provides syntax colorization, IntelliSense (completions) and snippets when writing Azure CLI scripts.

A second alternative is the Azure Cloud Shell, which you can use from within Visual Studio Code using the the Azure Account extension.

Azure subscription

If you don't have an Azure subscription, sign up now for a free account with $200 in Azure credits to try out any combination of services.

Sign in to the Azure CLI

Once the Azure CLI is installed, run the following command from a terminal or command prompt:

az login

The command opens a browser window in which you're asked to log into Azure. Once you're logged in, the terminal window shows JSON output with details of your subscription.

Check npm version

If you already had Node.js installed, run the node -v command and verify that the version is 10.x or higher. If you have an older version, upgrade to the most current LTS ("Long Term Support") release.