A web application running in a Linux-based Azure App Service environment within resource group `rg1` is failing to start up. To diagnose the initialization error, you want to inspect the output sent to standard output (stdout) and standard error (stderr) by enabling local filesystem logging.
Which Azure CLI command should you execute to enable this diagnostic log collection for the app named `webapp1`?
- az webapp log config --name webapp1 --resource-group rg1 --docker-container-logging filesystemAnswer
- Baz webapp log config --name webapp1 --resource-group rg1 --application-logging true
- CAdd the Application Insights SDK to your application and execute the startup sequence without specifying a Connection String, expecting App Service to automatically route stdout/stderr to Azure Monitor.
- DCreate an App Configuration key named log-path and set its value using the @Microsoft.KeyVault(SecretUri=...) syntax to point to the App Service log folder.
Answer
Execute the command `az webapp log config --name webapp1 --resource-group rg1 --docker-container-logging filesystem` to enable container logging.
The correct command uses `--docker-container-logging filesystem` which enables the collection of standard output and standard error streams from the Docker container hosting the Linux App Service application, saving them to the local filesystem.
Step-by-Step Solution
Key Concept
Configuring container logging on Linux-based Azure App Services to capture console output.
Estimated Time:1m 30s