AZ-104 Question 251
Select 2Your company runs a line-of-business web application on Azure App Service. A new compliance requirement mandates that all web server logs must be stored in a single Log Analytics workspace for a minimum of 90 days. Which of the following actions should you perform to meet this requirement? (Choose two)
- A
Create a new diagnostic setting on the App Service to send logs to an existing Log Analytics workspace
- B
Enable Azure Monitor alerts to automatically collect logs and store them in Azure Storage
- C
Set the retention period to 90 days in the properties of the Log Analytics workspace
- D
Use Azure Monitor for containers to collect logs from the web application
Show answer and explanation
Correct answers: A, C
Explanation
To satisfy the compliance requirement, you must create a diagnostic setting to route logs to a Log Analytics workspace and configure that workspace’s retention to meet the 90-day mandate. Alerts or container-focused monitoring do not address this specific need.
- A. Correct.
Creating a diagnostic setting on the App Service and sending logs to a Log Analytics workspace is essential for centralizing and storing logs in Azure Monitor.
- B. Incorrect.
Enabling alerts only notifies you based on conditions; it does not automatically collect and store logs for auditing or long-term retention.
- C. Correct.
Configuring the workspace retention period ensures that logs are preserved for the required duration (90 days) in the Log Analytics workspace.
- D. Incorrect.
Azure Monitor for containers is specifically designed for containerized environments such as Azure Kubernetes Service (AKS), not for standard web applications.