For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-azure-small-activity-log-retention-period.md.
A documentation index is available at /llms.txt.
Activity Log retention must be configured to retain logs for at least 365 days (or indefinitely). Short retention windows hinder incident response, forensic investigations, and regulatory compliance.
For Ansible azure.azcollection.azure_rm_monitorlogprofile / azure_rm_monitorlogprofile resources, the retention_policy.enabled property must be true and retention_policy.days must be set to 365 or greater, or to 0 to retain logs indefinitely. Tasks that omit retention_policy, set retention_policy.enabled to false (or no), or set retention_policy.days to a value between 1 and 364 are flagged.