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:
- 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
- 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
- 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
- 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
- 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.