App Service .NET web app cycles continuously with no error logs

Sean Ivins 5 Reputation points
2024-12-05T15:14:27.7566667+00:00

My app deploys successfully, but when I navigate to the url, it just says "Your web app is running and waiting for your content". When I check the logs, it shows all of the app startup logs, concluding with "Container <container> for site <site> initialized successfully and is ready to serve requests", then it starts back over with "Initiating warmup request to container <container> for site <site>".

I have 30 other apps running on this service plan with the same startup code. The app runs successfully in AKS (we're trying to migrate to app services), and when I debug locally. I've tried scaling up the service plan.

Where should I be looking for the reason the app is cycling?

Developer technologies ASP.NET ASP.NET Core
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
Developer technologies .NET Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sean Ivins 5 Reputation points
    2024-12-06T15:15:44.2833333+00:00

    Thank you @brtrach-MSFT for the helpful suggestions. The problem ending up being that I specified the wrong project in a multi-project solution when publishing the dotnet app in my pipeline. I specified a class library csproj instead of the web application.

    1 person found this answer helpful.
    0 comments No comments

  2. brtrach-MSFT 17,731 Reputation points Microsoft Employee Moderator
    2024-12-06T00:33:07.1566667+00:00

    @Sean Ivins It sounds like your app is stuck in a restart loop, which can be tricky to diagnose without specific error logs. Here are some steps and areas to investigate:

    1. Enable Detailed Logging: Ensure that detailed logging is enabled for your App Service. This includes application logging, web server logging, and failed request tracing. This can help capture more detailed information about what might be causing the restarts.
    2. Check Application Insights: If you have Application Insights configured, check for any telemetry data that might indicate issues during startup or runtime
    3. Review Startup Code: Since the app runs successfully in AKS and locally, there might be differences in the environment or configuration. Double-check your startup code for any environment-specific configurations or dependencies that might not be available or configured correctly in App Service. See if your web app is configured to use the correct startup file. You can check this by going to the "Configuration" section of your app service and checking the "Startup Command" setting. Make sure it is set to the correct startup file that your app is using.
    4. Configuration Differences: Compare the configurations between your AKS deployment and the App Service deployment. Look for differences in environment variables, connection strings, or other settings that might affect the app's behavior
    5. Health Checks: If you have health checks configured, ensure they are not causing the app to restart. Misconfigured health checks can sometimes cause the app to be marked as unhealthy and restarted continuously.
    6. Runtime: Check if your web app is configured to use the correct version of .NET. You can check this by going to the "Application settings" section of your app service and checking the "Runtime stack" setting. Make sure it is set to the correct version of .NET that your app is using.
    7. Port Setting: Check if your web app is configured to use the correct port. You can check this by going to the "Configuration" section of your app service and checking the "Port" setting. Make sure it is set to the correct port that your app is using.

    Those are the most common scenarios that I can think of. Please review them and hopefully one of them is the cause for your issue.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.