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.)
- Create a diagnostic setting for the App Service that routes AppServiceConsoleLogs to the storage account.Answer
- Run the Azure CLI command az webapp log tail --name <app-name> --resource-group <group-name>.Answer
- CAdd the Application Insights SDK to the Java code without specifying a connection string, and view logs via the Live Metrics Stream.
- DIn the App Service logs settings, enable Application Logging (Blob) and configure a SAS token with Read-only permissions and a 10-year expiration.
Answer
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.
Step-by-Step Solution
Key Concept
Configuring diagnostic settings for Linux container logging and streaming container logs via CLI.