Skill 5.1.2
Configure log settings in Azure Monitor
Key Concepts
The activity log records subscription-level control plane events, such as who deleted a resource, for 90 days. Resource logs describe operations inside a resource, such as storage read requests or Key Vault access, and are not collected until a diagnostic setting sends selected categories and metrics to a Log Analytics workspace (for querying and alerts), a storage account (for cheap archiving), an event hub (for third-party SIEM tools) or a partner solution. A resource can have up to five diagnostic settings, and the activity log is routed with its own subscription-level diagnostic setting. Azure Policy with DeployIfNotExists can create diagnostic settings at scale.
Data from inside VMs, such as Windows event logs, Linux syslog and performance counters, is collected by the Azure Monitor Agent (AMA) according to data collection rules (DCRs) that specify what to collect and where to send it; the legacy Log Analytics agent retired in August 2024. A Log Analytics workspace sets retention (31 days included by default for the Analytics plan, up to 12 years with long-term retention), table plans (Analytics, Basic, Auxiliary), daily caps and access mode.