Question

Difficulty: EasyDiagnose and Log App Service Web Apps

You have a web application deployed to an Azure App Service. You want to enable application logging to the local file system to troubleshoot a runtime issue. Which of the following actions should you perform to enable this logging?

  1. Run the az webapp log config command with the --application-logging true parameter.Answer
  2. B
    Add the Application Insights connection string to the application settings to initialize telemetry.
  3. C
    Scale the App Service plan up to a Premium tier to unlock diagnostic logging features.
  4. D
    Grant the App Service managed identity access to Key Vault secrets using an access policy.

Answer

Run the az webapp log config command with the --application-logging true parameter.
Running the az webapp log config command with the --application-logging true parameter is the standard, native method to enable application logs on the local file system using the Azure CLI. This modifies the App Service configuration directly without incurring additional billing or requiring external services.

Step-by-Step Solution

1
Identify the target diagnostic requirement.
Built-in application logging to the local file system needs to be enabled.
This determines which logging mechanisms and configurations are relevant.
2
Determine the correct command-line parameter.
Use the --application-logging true parameter with the az webapp log config command.
This is the native configuration mechanism for enabling App Service application logs.
3
Differentiate from external monitoring and access permissions.
Exclude Application Insights, Key Vault access policies, and hosting plan scaling.
These services are not dependencies for built-in local file system logging.

Key Concept

Enabling application logging to the file system in Azure App Service
Estimated Time:45s
Rate this question