You are troubleshooting a startup failure in an ASP.NET Core web application deployed to a Linux Azure App Service. The application fails to initialize, and you need to capture container startup logs to identify the error. You decide to use the Azure CLI to enable container logging, trigger a container restart to generate fresh telemetry under the new configuration, stream the startup log sequence in real time, and download the log zip archive for offline analysis.
Arrange the steps in the correct order to configure, capture, and retrieve these logs.
- 1Run `az webapp log config --name myApp --resource-group myRG --docker-container-logging filesystem` to configure logging.
- 2Run `az webapp restart --name myApp --resource-group myRG` to restart the web application.
- 3Run `az webapp log tail --name myApp --resource-group myRG` to initiate log streaming.
- 4Run `az webapp log download --name myApp --resource-group myRG` to retrieve the log archive.
Answer
To properly diagnose the startup failure, first configure container filesystem logging, restart the application to trigger a fresh initialization attempt, stream the live stdout/stderr streams to observe the failure in real time, and then download the persistent log archive for detailed offline analysis.
The correct order follows a logical pipeline: first, configure the logging infrastructure to persist docker container logs on the file system; second, restart the application to trigger a new container initialization attempt under the active log configuration; third, open a real-time stream to observe stderr/stdout streams during the startup cycle; and fourth, download the full Kudu log archive to get detailed system-level files for offline debugging.
Step-by-Step Solution
Key Concept
Azure App Service container diagnostics, log configuration, real-time log streaming, and download logs via Azure CLI.
Estimated Time:3m 0s