Application Error message when browsing Azure deployed web app

亡梦爱人 提交于 2021-02-17 01:52:17

问题


I created a simple web app (serverless) and deployed the web app using Azure App Service VS Code extension. I chose Linus + 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.


回答1:


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

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

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

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




回答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



来源:https://stackoverflow.com/questions/59039716/application-error-message-when-browsing-azure-deployed-web-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!