Server container is always restarting

Adeola Folarin 20 Reputation points
2024-07-09T10:10:39.21+00:00

We are deploying our backend using an Azure web app. We decided not to use serverless Azure Functions based on our experience with Firebase functions, as they usually do not allow file uploads within the same application.

On Azure, the problem is that the server container is always restarting, which means the APIs are not readily available. We have created a resource group. In fact, we tried changing the price plan from Basic B1 to B2, to Standard S1, S2, and later to Premium to check if the problem had anything to do with the price plan. However, only B1 works for a while before restarting, while the others shut down immediately after the server starts.

Any suggestion on how to resolve the Server restarting issue

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,333 questions
{count} votes

Accepted answer
  1. Adharsh Santhanam 2,705 Reputation points
    2024-07-09T13:16:55.26+00:00

    Hello Adeola Folarin, based on what you're saying here, it's extremely unlikely that this is happening due to a fault on the app service server side. Here are some possible causes that's causing the server to restart/not be available:

    1. Check the API logs to identify any errors or exceptions. You can find these logs in the Azure portal under the app service's "Diagnostic logs" section. Look for any specific error messages related to your API code
    2. Ensure that your app/API isn't exceed memory or CPU limits. High resource usage can cause automatic restarts. Monitor the resource utilization using the Azure portal or using tools like Application Insights
    3. If your API takes a long time to start, it might exceed the startup timeout. Consider optimizing your startup time. You can also increase the startup timeout in the web.config or appsettings.json file
    4. Check if your API has any dependencies (such as databases, external services, or configuration files) that might be causing delays during startup. Ensure that all required dependencies are available and properly configured
    5. Implement health checks in your API. Azure App Service performs health checks to determine if your app is healthy. If your app/API fails health checks consistently, it might trigger restarts

    If the issue still persists, try opening a support ticket with Microsoft to investigate.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful