Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure webapp node.js app not starting

I'm trying to deploy a very simple express.js app on Azure webapp.

The deployment log shows the that the deployment passes correctly but the app doesn't start. Checking the kudu process explorer shows that indeed the node.js process is not running

enter image description here

On the other hand I don't see any application logs nor any indication that the app even started.

Is there a way to see what happened when the nodeiis tried to start the app?

like image 808
Guy Korland Avatar asked May 09 '16 04:05

Guy Korland


People also ask

How do I troubleshoot Azure webapp?

Open App Service diagnostics To access App Service diagnostics, navigate to your App Service web app or App Service Environment in the Azure portal. In the left navigation, click on Diagnose and solve problems.

How do I start an app in node JS?

The usual way to run a Node. js program is to run the globally available node command (once you install Node. js) and pass the name of the file you want to execute. While running the command, make sure you are in the same directory which contains the app.


3 Answers

Azure WebApp for node.js is running via iisnode as a native IIS module that allows hosting in IIS on Windows. Please see the document https://blogs.msdn.microsoft.com/silverlining/2012/06/14/windows-azure-websites-node-js/ to know its features.

For debugging the webapp for node.js, I suggest you can refer to the document to know how to do it.

If you are using Visual Studio as the IDE for node.js, I recommend installing NTVS in VS for debugging and deploying the node.js. Please see the documents below to know how to get started.

  1. Installation for NTVS
  2. Install Node.js and get started with NTVS

And there is an other tool called node-inspector for inspecting the node.js app on Azure. As reference, you can refer to the doc http://www.ranjithr.com/?p=98.

Meanwhile, please check the web.config file in your node webapp via Kudo Console, you can compare your codes with the sample generated by the template for Express from Gallery on Azure portal.

Hope it help. Any concern, please feel free to let me know.


The process explorer shows the processes of my webapp for node.js. enter image description here

like image 171
Peter Pan Avatar answered Nov 06 '22 03:11

Peter Pan


You need to enable logging before you can get logs that would (hopefully) give you more details about the error. You can read more about it here.

like image 36
David Ebbo Avatar answered Nov 06 '22 03:11

David Ebbo


post my investigation step in here.
1. edit D:\home\site\wwwroot\iisnode.yml, from https://xxx.scm.azurewebsites.net/DebugConsole add below line

devErrorsEnabled: true  
  1. restart app service from Azure portal
  2. access your service, you will see something like this:

HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error

  1. go to https://learn.microsoft.com/en-us/azure/app-service/app-service-web-nodejs-best-practices-and-troubleshoot-guide#iisnode-http-status-and-substatus to find the meanings for substatus.

for more debugging skill, you can see: https://prmadi.com/debug-nodejs-app-in-azure-app-services-windows-2/

like image 1
Redman Avatar answered Nov 06 '22 03:11

Redman