Question

Difficulty: MediumDiagnose and Log App Service Web Apps

You are troubleshooting a web application hosted on a Windows-based Azure App Service named `webapp1` in a resource group named `rg1`. You need to enable application logging to the local file system with a Verbose level, and then view the logs in real-time as they are generated. Which two Azure CLI commands should you run to meet these requirements?

  1. az webapp log config --name webapp1 --resource-group rg1 --application-logging true --level verboseAnswer
  2. az webapp log tail --name webapp1 --resource-group rg1Answer
  3. C
    az webapp log config --name webapp1 --resource-group rg1 --web-server-logging storage --storage-container-url "https://mystorage.blob.core.windows.net/logs"
  4. D
    az monitor app-insights component update --app webapp1 --resource-group rg1

Answer

To resolve the logging requirement, run the command to configure application logging with a verbose level to true, and then use the log tail command to stream the logs in real-time.
The correct actions are to enable application logging to the filesystem with the log config command using the verbose level, and then to stream the logs in real-time by using the log tail command.

Step-by-Step Solution

1
Configure the App Service to enable filesystem application logging.
Application logging is enabled with the verbosity level set to verbose.
The application must be configured to output logs before they can be streamed.
2
Initiate the log streaming process using the tail command.
A live console stream of application logs is established.
Streaming logs in real-time requires tailing the active log files.

Key Concept

Enabling and streaming local file system application logs for Azure App Service Web Apps using the Azure CLI.
Rate this question