Question

Difficulty: EasyDiagnose and Log App Service Web Apps

You are developing a web application hosted on an Azure App Service. You need to enable application logging to the file system and view the log messages in real-time using the Azure CLI. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

  1. 1Run the az webapp log config command with the --application-logging true parameter.
  2. 2Run the az webapp log tail command.
  3. 3Navigate to the web application URL to generate HTTP traffic.

Answer

First, run the az webapp log config command with the --application-logging true parameter. Second, run the az webapp log tail command. Third, navigate to the web application URL to generate HTTP traffic.
To view application logs in real-time, you must first enable file system application logging by running the configure command with the application-logging flag set to true. Once configured, you run the tail command to start the live log stream, and then perform actions in the application to generate log entries.

Step-by-Step Solution

1
Enable filesystem application logging using Azure CLI
Application logging to the file system is enabled for the Web App
By default, application logging to the file system is disabled. It must be enabled before you can stream logs.
2
Start the log stream session
Real-time log streaming begins in the command line interface
Initiating the tail command starts listening for diagnostic events from the Web App.
3
Browse the web application
Diagnostic trace and log outputs appear live in the terminal
Generating web requests triggers the application execution which produces the log entries to stream.

Key Concept

Enabling and streaming Web App application logs using Azure CLI
Rate this question