1. 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). With the Azure CLI you can:
Create Azure resource.
Set up a deployment pipeline between a Git repository and Azure.
Push changes to Azure App service
View the app's
console.logoutput in a streaming log.Sample code - simple express application
Prerequisites
- An Azure subscription.
- Node.js LTS, the Node.js package manager.
- Git, after which the command
git --versionshould show a version number.
Use Azure Cloud Shell using the bash environment.
If you prefer, install the Azure CLI to run CLI reference commands.
- If you're using a local install, sign in with Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. See Sign in with Azure CLI for additional sign-in options.
- When you're prompted, install Azure CLI extensions on first use. For more information about extensions, see Use extensions with Azure CLI.
- Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
Sign in to Azure with Azure CLI
Run the
logincommand.az loginIf the CLI can open your default browser, it will do so and load an Azure sign-in page.
Otherwise, open a browser page at https://aka.ms/devicelogin and enter the authorization code displayed in your terminal.
Sign in with your account credentials in the browser.
