Hi @Emre Deveci ,
Thanks for the question and using MS Q&A platform.
It appears that your Node.js application is encountering issues when deployed on Azure App Service, although it functions correctly on localhost and Google Cloud.
- Ensure your web.config file is configured properly. If removing the web.config file allows part of the page to load, review its contents to ensure it is correctly set up for your application. Azure App Service requires this file for handling requests appropriately.
- Verify that your application is listening on the port specified by the PORT environment variable. This should be configured in your startup script (e.g., bin/www) in your Express app.
- Test your application locally in production mode to ensure it behaves as expected. Azure runs Node.js apps in production mode, which may impact how packages are loaded or static files are served.
- Access the log stream in Azure to identify any errors that might provide insight into the deployment issues.
- If using FTP or ZIP deployment, ensure the deployment is set up correctly and all necessary files are included.
- Add the setting SCM_DO_BUILD_DURING_DEPLOYMENT with the value true in the Application Settings of your Azure App Service. This enables build automation, which can assist in generating the web.config file correctly.
- Confirm that all dependencies listed in your package.json are installed correctly in Azure. Environmental differences can sometimes cause issues with package loading.
Let me know if you have any assistances.
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.
References: