Forum Discussion

ankush_kulkarni's avatar
ankush_kulkarni
Occasional Reader
May 07, 2025

Azure app service getting restarted abruptly

I have an Azure app service with app service plan P1mv3 : 1.

We have deployed the .net 8 web api project which has a background service as well.

Background service does below things -

  1. Get the journal data from one of our on-premises endpoint for 1700 journals.
  2. Generate the embeddings for all the journal names in the batches of 100 with a delay of 5 seconds after each batch using Azure open AI. We use these embeddings for vector search in cosmos db to better search by journal title.
  3. Delete all the records from existing cosmos DB container in the batches of 100 with a delay of 5 seconds after each batch. We do this as we need to insert the fresh data each week.
  4. Insert all the records with embeddings generated in step-2 in cosmos DB container in the batches of 100 with a delay of 10 seconds after each batch.

The problem is once we deploy this to app service after verifying that everything works fine on local system, the app service just generates 800/1000 out of 1700 embeddings and just restarts. We can see the logs as "Hosting environment: Production", "Content root path: c:\home\site\wwwroot" etc after our custom logs depicting the progress to generate the embeddings. e.g. Progress: 1000/1700 items embedding results generated.

1 Reply

  • Please find below the potential cause:

     

    1. Memory or CPU Limits
    2. App Service Plan Scaling
      • The P1mv3 plan has limited resources
    3. Platform Maintenance
    4. Application Crashes
    5. Auto-Healing Settings

Resources

OSZAR »