10

I created a simple web app (serverless) and deployed the web app using Azure App Service VS Code extension. I chose Linux + Node LTS environment. I configured deployment source to a local Git repo (also tried remote GitHub repo) and deployed. The deployment shows successful message. But when I browse the site, it throws a message (after 3-4 mins) that there was an ":( Application error". The admin diagnostics link doesn't show any error. Any reason why this could be happening? Where can I find error details? The web app compiles/runs fine on the local host.

4 Answers 4

6

Enable Log Streamming, then you'll be able to figure out what the problem is:

https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs

As another option, you can also instrument your application with Application Insights:

https://learn.microsoft.com/en-us/azure/azure-monitor/app/nodejs

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks. When I stream logs, I see a message "did not start within expected time limit." and to see "container logs for debugging". Where can I see that?
Thanks. It leads to just this message and nothing more. "An unknown error has occurred. Check the diagnostic log for details." This is so complex. Thanks for your help.
you're welcome. In case it answers your question, mark as a reply
2

On Azure WebApps, the container/application must respond to HTTP pings on the required port (check docker run command in the Log Stream) within 230 seconds, by default.

For a NodeJS app, you'd need to start the server in the following way:

const port = process.env.PORT || 1337;
server.listen(port);

Try deploying the sample available here: https://github.com/Azure-Samples/nodejs-docs-hello-world

If that does not help, enable App Service Logs and check for any errors in the Log Stream.

I had created a NodeJS app which integrates with Application Insights some days back: https://github.com/gkgaurav31/nodejs-application-insights-test-app

Comments

1

change your listen port either 8080 or 1337

Comments

1

By default, NodeJS webapp runs on port 8080. You are either running your port on some other port (Ex: 3000 or so) and then deploying it to webapp. Try changing your port in NodeJS app to 8080 and it should work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.