Hello @Lukasz Kulas,
Thank you for posting your query on Microsoft Q&A.
If your application is returning 500 Errors when it starts, there could be a few reasons:
- Node.exe is not present at the correct location. Check nodeProcessCommandLine setting.
- Main script file is not present at the correct location. Check web.config and make sure the name of the main script file in the handler's section matches the main script file.
- Web.config configuration is not correct – check the settings names/values.
- Cold Start – Your application is taking too long to start. If your application takes longer than (maxNamedPipeConnectionRetry * namedPipeConnectionRetryDelay) / 1000 seconds, iisnode returns a 500 error. Increase the values of these settings to match your application start time to prevent iisnode from timing out and returning the 500 error.
Refer to this document link for troubleshooting- https://learn.microsoft.com/en-us/azure/app-service/app-service-web-nodejs-best-practices-and-troubleshoot-guide
To check the logs, I'd recommend enabling logging service for Azure App Service:
Enable diagnostics logging for apps in Azure App Service
https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs
Click on App Service logs in settings option and Turn On Application logging (Filesystem).
These logs will be able to give you more insight into what is causing the app to error out.
If above steps didn't fix the issue, please refer the below troubleshooting document.
https://azureossd.github.io/2022/10/17/troubleshooting-common-iisnode-issues/index.html
I hope this information is helpful. Please feel free to reach out if you have any further questions.
Please Accept the answer
if the information helped you. This will help us and others in the community as well.
Thanks,
Raja Pothuraju.