Soru

Zorluk: ZorDiagnose and Log App Service Web Apps

You deploy a Java application to a Linux-based Azure App Service. You must configure a diagnostic logging solution that meets the following requirements:
- Capture the stdout and stderr streams of the container and save them to an Azure Storage account for long-term archiving.
- View the logs in real-time from your local terminal during troubleshooting sessions.

Which two actions should you perform? (Choose two.)

  1. Create a diagnostic setting for the App Service that routes AppServiceConsoleLogs to the storage account.Cevap
  2. Run the Azure CLI command az webapp log tail --name <app-name> --resource-group <group-name>.Cevap
  3. C
    Add the Application Insights SDK to the Java code without specifying a connection string, and view logs via the Live Metrics Stream.
  4. D
    In the App Service logs settings, enable Application Logging (Blob) and configure a SAS token with Read-only permissions and a 10-year expiration.

Cevap

Create a diagnostic setting for the App Service that routes AppServiceConsoleLogs to the storage account, and run the Azure CLI command az webapp log tail --name <app-name> --resource-group <group-name>.
To archive stdout/stderr on Linux App Services, you must route AppServiceConsoleLogs to your target destination using Diagnostic Settings. To view live logs directly from the terminal, the CLI tail utility must be invoked.

Adım Adım Çözüm

1
Determine the correct log category for stdout and stderr on a Linux App Service.
stdout and stderr streams from a Linux container in Azure App Service are classified under AppServiceConsoleLogs.
This is different from Windows App Services, which write application trace calls to AppServiceAppLogs.
2
Select the appropriate mechanism to archive logs to a storage account.
Create an Azure Monitor Diagnostic Setting to stream AppServiceConsoleLogs to the storage account.
Linux App Services do not support direct configuration of Application Logging to Blob Storage from the built-in portal settings.
3
Select the tool for real-time log streaming from a local CLI.
The CLI command 'az webapp log tail' connects to the streaming log endpoint.
This outputs log streams continuously to the console as they occur.

Anahtar Kavram

Configuring diagnostic settings for Linux container logging and streaming container logs via CLI.
Bu soruyu puanla