AZ-104 Question 250
Select 2You manage an Azure App Service and need to collect and retain diagnostic logs for long-term analysis. You are required to forward logs to a Log Analytics workspace for advanced queries and also archive them to a storage account. Which two actions should you configure in the Azure Monitor diagnostic settings for the App Service to meet these requirements?
- A
Create a new diagnostic setting targeting a Log Analytics workspace and enable Application Logging under this setting
- B
Enable 'Send to Event Hub' to stream all App Service logs to Azure automatically
- C
In the same diagnostic setting, select 'Archive to a storage account' and configure a retention policy
- D
Enable Application Insights to collect all logs without configuring diagnostic settings
Show answer and explanation
Correct answers: A, C
Explanation
To fulfill both the advanced analytics and long-term retention requirements, you must configure a diagnostic setting that sends logs to a Log Analytics workspace and also archives them to a storage account. Using 'Send to Event Hub' or relying solely on Application Insights would not meet the complete requirement for long-term retention and advanced queries.
- A. Correct.
Configuring a diagnostic setting that sends logs to a Log Analytics workspace enables advanced queries and dashboards in Azure Monitor
- B. Incorrect.
Sending logs to Event Hub provides real-time streaming, but it is not necessary for long-term retention and advanced queries in this scenario
- C. Correct.
Archiving logs to a storage account with a specified retention policy ensures you meet long-term data storage requirements
- D. Incorrect.
Application Insights is primarily for application performance management, but it does not replace the need for configuring diagnostic settings to forward and archive logs as described