You are troubleshooting an intermittent database connection timeout that occurs once every few days in an ASP.NET Core web application hosted on a Windows Azure App Service. You need to configure application logging to capture diagnostic traces written via the ILogger interface. The logging must remain active continuously for at least a week to ensure the event is captured.
Which configuration should you implement?
- Enable Application Logging (Blob) in the App Service Logs blade, set the level to Verbose, and select a storage container using a connection string that does not expire.Answer
- BEnable Application Logging (Blob) in the App Service Logs blade, set the level to Verbose, and configure the storage container using a Shared Access Signature (SAS) token that is valid for 12 hours.
- CEnable Application Insights for the web application by installing the Application Insights SDK in code, but omit configuring the APPLICATIONINSIGHTS_CONNECTION_STRING app setting, relying on the App Service to automatically route telemetry.
- DConfigure the web application to stream logs to Azure Blob Storage by storing the connection string in an Azure Key Vault secret, referenced in the App Service configuration, without granting the App Service's system-assigned managed identity a GET permission in the Key Vault access policies.
Answer
Enable Application Logging (Blob) in the App Service Logs blade, set the level to Verbose, and select a storage container using a connection string that does not expire.
The correct option is to enable Application Logging (Blob) in the App Service Logs blade, set the level to Verbose, and select a storage container using a connection string that does not expire. Unlike filesystem logging on Windows App Service, which is designed for temporary troubleshooting and automatically disables after 12 hours, Blob-based logging remains enabled indefinitely. Using a persistent connection string ensures the logs are gathered continuously for the entire week.
Step-by-Step Solution
Key Concept
App Service Application Logging Persistence and Security Configurations
Estimated Time:2m 0s