Soru

Zorluk: ZorDiagnose and Log App Service Web Apps

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?

  1. 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.Cevap
  2. B
    Enable 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.
  3. C
    Enable 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.
  4. D
    Configure 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.

Cevap

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.

Adım Adım Çözüm

1
Analyze the requirements for the logging duration.
The logging must remain active continuously for at least a week to capture an intermittent issue.
Since the issue occurs once every few days, temporary file-system based logging (which turns off after 12 hours on Windows App Services) is insufficient.
2
Evaluate the authentication and authorization prerequisites.
Using a SAS token with a 12-hour expiration or a Key Vault reference without appropriate access policy permissions will cause the logging mechanism to fail prematurely.
Security configurations must persist and allow read/write access to the destination storage for the entire test duration.
3
Select a logging destination that supports persistent collection.
Application Logging (Blob) with a non-expiring connection string provides the necessary persistence.
Blob-based application logging does not automatically disable after a set timeframe and stays active until manually turned off.

Anahtar Kavram

App Service Application Logging Persistence and Security Configurations
Tahmini Süre:2m 0s
Bu soruyu puanla