Where can I find docker container logs for Azure App Service

后端 未结 5 2300
没有蜡笔的小新
没有蜡笔的小新 2021-02-20 10:40

I do have a Docker container running a .net core 2 app.

The logging is configured using this code in Program.cs

public static IWebHostBuilde         


        
5条回答
  •  失恋的感觉
    2021-02-20 11:18

    I have the same exact issue, the App Service container logs is generic and vague. This is not the same logs that Docker shows us whenever we run a container.

    17/02/2020 08:59:25.186 INFO - Site: tutorial-api - Start container succeeded. Container: f8bfa7e27680c0e9551c6157f9d1c8a73c9a3e739b4f15de8586ce52809798d3 17/02/2020 08:59:30.675 INFO - Site: tutorial-api - Application Logging (Filesystem): On 17/02/2020 08:59:44.106 INFO - Site: tutorial-api - Waiting for container to be ready 17/02/2020 08:59:49.116 INFO - Site: tutorial-api - Container has exited 17/02/2020 08:59:49.117 ERROR - Site: tutorial-api - Container could not be started 17/02/2020 08:59:49.120 INFO - Site: tutorial-api - Purging after container failed to start 17/02/2020 08:59:49.120 ERROR - Site: tutorial-api - Unable to start container. Error message: Container could not be started: tutorial-api_20

    "Unable to start container, container couldn't be started"

    Wow! Azure just told me every 60 seconds a minute has passed.

    I understand that this is production environment, but you got to give us something!

    Out of frustration, I decided to run same image in a Azure Container Instance resource, there it shows you the same detailed logs that Docker provides (see screenshot below)

    Now that's what I'm talking about!

    Using the error logs in Azure Container Instance, I found out that my App Service couldn't access the Sql Server resource (even though they are within the same resource group). I simply enabled the Sql Server resource to be accessed within the same resource group

提交回复
热议问题