Hi Tejaswini,
Your Azure App Service has an issue with the deployed Next.js app. Specifically, the application’s container is exiting and is unable to respond to HTTP pings.
Ensure your container’s configuration file is set to listen on the correct port. You stated that the PORT environment variable was set, which is great, but also confirm that your Next.js application is configured to listen to that port as well.
If the App Service Plan is under allocated in resources like CPU and memory, the container will not run as expected. Insufficient resources can lead to unexpected container exits.
A few reasons your application can exit unexpectedly is if there are unhandled exceptions or errors in the code. To troubleshoot, try running the app locally to see if there are any issues that may not be obvious in the Azure logs.
For custom Docker containers, ensure that the configurations for DOCKER_CUSTOM_IMAGE_NAME and STARTUP_COMMAND are set.
If you have access, attempt to run the container locally with Docker first. Testing the container outside of Azure can determine if the issue is related to the Azure environment or the application.
https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-hybrid#enable-logging-for-nextjs
https://learn.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-9.0
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-iis-errors-reference?view=aspnetcore-9.0
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.
Let me know if you have any further Queries.