Deploy Node.js app to VM in Azure Stack Hub - Azure Stack Hub (2024)

  • Article

You can create a virtual machine (VM) to host a Node.js web app in Azure Stack Hub. In this article, set up a server, configure the server to host your Node.js web app, and then deploy the app to Azure Stack Hub.

If you are looking for general information about global Azure, see Azure for JavaScript & Node.js developers. This article is for using Azure Stack Hub, an on-premises version of Azure.

Create a VM

  1. Set up your VM in Azure Stack Hub by following the instructions in Deploy a Linux VM to host a web app in Azure Stack Hub.

  2. In the VM network pane, make sure that the following ports are accessible:

    PortProtocolDescription
    80HTTPHypertext Transfer Protocol (HTTP) is the protocol that's used to deliver webpages from servers. Clients connect via HTTP with a DNS name or IP address.
    443HTTPSHypertext Transfer Protocol Secure (HTTPS) is a secure version of HTTP that requires a security certificate and allows for the encrypted transmission of information.
    22SSHSecure Shell (SSH) is an encrypted network protocol for secure communications. You use this connection with an SSH client to configure the VM and deploy the app.
    3389RDPOptional. The Remote Desktop Protocol (RDP) allows a remote desktop connection to use a graphic user interface on your machine.
    3000CustomThe port that's used by the Node.js Express framework. For a production server, you route your traffic through 80 and 443.

Install Node

  1. Connect to your VM by using your SSH client. For instructions, see Connect via SSH with PuTTY.

  2. At the bash prompt on your VM, enter the following command:

     sudo apt-get update sudo apt-get install nodejs sudo apt-get install npm

    This also installs NPM, a package manager for Node.js packages, or modules.

  3. Validate your installation. While you're still connected to your VM in your SSH session, enter the following command:

     node --version

Scaffold a new application with the Express Generator

Express is a popular framework for building and running Node.js applications. You can scaffold (create) a new Express application using the Express Generator tool. The Express Generator is shipped as an npm module and can be run directly (without installation) by using the npm command-line tool npx.

 npx express-generator myExpressApp --view pug --git

The --view pug --git parameters tell the generator to use the pug template engine (formerly known as jade) and to create a .gitignore file.

To install all of the application's dependencies, go to the new folder and run npm install.

cd myExpressAppnpm install

Run the application. From the terminal, start the application using the npm start command to start the server.

Go to your new server in a Web browser. You should see your running web application. You can find the URL for your Linux VM in the Azure Stack Hub user portal labeled DNS name.

http://yourhostname.contoso.com:3000

Next steps

Deploy Node.js app to VM in Azure Stack Hub - Azure Stack Hub (2024)
Top Articles
Affiliate Marketing 101: What it is and How to Get Started
S&P 500 Historical Annual Returns
Thor Majestic 23A Floor Plan
Main Moon Ilion Menu
How Much Does Dr Pol Charge To Deliver A Calf
Coindraw App
سریال رویای شیرین جوانی قسمت 338
Nwi Police Blotter
Fire Rescue 1 Login
Seattle Rpz
Moparts Com Forum
Peraton Sso
Apus.edu Login
Uky Linkblue Login
Craigslist Portland Oregon Motorcycles
Ruben van Bommel: diepgang en doelgerichtheid als wapens, maar (nog) te weinig rendement
Effingham Bookings Florence Sc
Labby Memorial Funeral Homes Leesville Obituaries
How To Level Up Roc Rlcraft
Arre St Wv Srj
Kountry Pumpkin 29
Sulfur - Element information, properties and uses
18889183540
Menards Eau Claire Weekly Ad
Nz Herald Obituary Notices
12 Facts About John J. McCloy: The 20th Century’s Most Powerful American?
Mineral Wells Skyward
Roanoke Skipthegames Com
SOGo Groupware - Rechenzentrum Universität Osnabrück
3 Ways to Drive Employee Engagement with Recognition Programs | UKG
Fuse Box Diagram Honda Accord (2013-2017)
Jesus Calling Feb 13
The value of R in SI units is _____?
Otis Offender Michigan
Justin Mckenzie Phillip Bryant
The Ride | Rotten Tomatoes
Snohomish Hairmasters
Troy Gamefarm Prices
Easy Pigs in a Blanket Recipe - Emmandi's Kitchen
Mytime Maple Grove Hospital
Craigslist Boats Dallas
Bustednewspaper.com Rockbridge County Va
RubberDucks Front Office
Aznchikz
Abigail Cordova Murder
Theater X Orange Heights Florida
Grace Family Church Land O Lakes
Understanding & Applying Carroll's Pyramid of Corporate Social Responsibility
Strawberry Lake Nd Cabins For Sale
Arnold Swansinger Family
The Significance Of The Haitian Revolution Was That It Weegy
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 5761

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.