Search code examples
azuredaprazure-container-apps

How do I diagnose a failed Azure Container App revision?


I'm currently working through some Azure Container App quick starts. I've just attempted to create one that's Dapr enabled with storage account state store. It has a provision status of failed but seemingly no other information. I'm not aware of how to access any logs from the container and there's nothing in the Log Analytics workspace. The others examples I've tested have worked so far so I think it's related to the Dapr config.

Is there a way to attach to the container and see what's happening? Or anywhere I can find more detail on what error is being thrown?


Solution

  • Here is what sequence of actions helped me sort out what was going on in my case:

    1. Open Azure Container App (Screenshot 1)
    2. Go to Revision management (Screenshot 1)
    3. Find out which revision fails and click on its name. The Details panel should pop to the right. (Screenshot 1)
    4. Click "View details" next to "System logs". The Logs screen will open. (Screenshot 1)
    5. Scroll to the bottom and search for the log that describes what went wrong. (Screenshot 2)
    6. In my case the issue description was "Container was terminated with error code '1'". I googled it online and found out the following "Exit Code 1: Indicates failure due to application error". Which means that I had an error in the code. For you, the message in the logs might be different. So pay attention. (Screenshot 2)

    Screenshot 1

    Screenshot 2