Soru

Zorluk: ZorDiagnose and Log App Service Web Apps

You are developing a web application named webapp1 hosted on a Windows-based Azure App Service in resource group rg1. During a testing phase, you need to diagnose startup crashes by enabling filesystem-based application logging, establishing a real-time log monitoring pipeline, triggering runtime execution, and obtaining the complete diagnostic log archive for offline verification. Which sequence of actions should you perform? Arrange the actions in the correct order.

  1. 1Run `az webapp log config --name webapp1 --resource-group rg1 --application-logging true --level error` to configure the diagnostic log settings.
  2. 2Run `az webapp log tail --name webapp1 --resource-group rg1` to establish a live log streaming session in your terminal.
  3. 3Send HTTP requests to the web application URL to trigger runtime execution and generate the diagnostic trace logs.
  4. 4Run `az webapp log download --name webapp1 --resource-group rg1` to retrieve the historical zip package containing persistent log directories.

Cevap

First, configure application logging to the file system using the `az webapp log config` command. Next, start the live log stream with `az webapp log tail`. Following that, make HTTP requests to the web application to generate traffic and write to the logs. Finally, download the historical log archive using `az webapp log download`.
The correct order proceeds from configuring the underlying log system, setting up the observer stream, triggering the target event, and finally downloading the persistent historical records. File-system application logging must first be enabled because it is disabled by default. Running the tail command next ensures that any live events generated during the subsequent HTTP requests are captured in the terminal stream. Finally, downloading the log bundle retrieves the full persistent log folder for subsequent analysis.

Adım Adım Çözüm

1
Enable and configure application filesystem logging using Azure CLI.
App Service configures the application log buffer to write errors to the local virtual filesystem.
By default, application logging to the filesystem is disabled, so configuring it is a prerequisite for capturing log traces.
2
Initiate the log streaming pipeline in the terminal.
A streaming channel is opened to capture stdout/stderr and trace events from the App Service.
To observe real-time startup errors or execution traces, the stream tail must be active before triggering the workflow.
3
Generate traffic to the application.
The web application processes the requests, encountering errors that are outputted to the active streaming session.
Without HTTP request traffic or application runtime events, no logs will be generated to populate the active log stream.
4
Download the diagnostic log zip file.
A zip file containing all log subdirectories (such as LogFiles/Application/) is downloaded locally.
Downloading the archive is the final step to keep a permanent offline record of all generated diagnostic files.

Anahtar Kavram

Azure App Service Application Diagnostics and CLI Logging Commands
Tahmini Süre:2m 0s
Bu soruyu puanla