Why does my Azure Container App reset itself randomly?

William Huynh 20 Reputation points
2024-02-27T16:51:10.64+00:00

I have an Azure Container App that is just one replica and one container. Roughly once a week or so, the container resets itself and I have to recreate my directories and reinstall all my packages again. Historically, it would only happen in the middle of the night. But today, it happened at around 15:47 UTC or 7:47am Pacific time which can be catastrophic for my use case. Under Diagnose and Solve Problems > Availability and Performance, my CPU usage and memory usage are well below the high usage warnings and my replica restart count has never been anything other than 0. Why is this happening and how can we prevent it from happening again in the future?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
324 questions
0 comments No comments
{count} votes

Accepted answer
  1. Silvia Wibowo 3,411 Reputation points Microsoft Employee
    2024-02-27T18:48:23.4566667+00:00

    Hi @William Huynh , I understand that you have an Azure Container Apps and found that it restarts itself regularly, which causes you to lose your directory and packages.

    First, regarding restarting itself. Please note that Azure Container Apps restart regularly, so don't expect state to persist inside a container.

    Azure Container Apps has a Container-scoped storage (its own files system). Container file system storage has the following characteristics:

    • The storage is temporary and disappears when the container is shut down or restarted.
    • Files written to this storage are only visible to processes running in the current container.

    You should include all necessary files/directories and installed packages in the container image, then deploy the container image into Azure Container Apps.

    If you need a persistent storage, you can mount an Azure Files volume to your Container Apps. More info: Azure Files volume for Azure Container Apps.

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.


0 additional answers

Sort by: Most helpful