codeshinobi
codeshinobi

Reputation: 114

Run NodeJS command on Azure

I am fairly new to NodeJS development. I have no issues whatsoever running commands on my local machine. For instance, say I want to install a package called "formidable" on my Node server, I'd run the command 'npm install formidable'. If I have deployed my NodeJS application to Azure, how would I run the same command?

NB - I do not want to manually run the command on my local machine and then deploy to Azure. This will take far too long, since I have to install many packages each with many files in them.

Please advise on how I go about doing this?

Thanks

Upvotes: 0

Views: 1746

Answers (2)

Gary Liu
Gary Liu

Reputation: 13918

Beside login KUDU console site and run command in online cmdlet. You also can configure dependencies in package.json, then you deploy your nodejs application to Azure via GIT, it will automatically install the dependencies in this file.

For example:

You add the formidable module in dependencies:

enter image description here

Then deploy it application on Azure Web Apps, you can see the remoting deployment logs in cmdlet that the module was added in the application on Azure, e.g.: enter image description here

You can refer to Create a Node.js web app in Azure App Service for how to create a nodejs application and deploy via GIT.

Upvotes: 2

Joe Raio
Joe Raio

Reputation: 1805

If you are running an Azure Web App you can use Kudu Services.

To do this

  • browse to http://yoursitename.scm.azurewebsites.net
  • It will ask you to authenticate if you have not already
  • Click on Debug Console -> CMD

You can run your npm commands from there.

Screen shot below

enter image description here

More information can be found here: https://github.com/projectkudu/kudu/wiki

Upvotes: 1

Related Questions