Ensure that Activity Log Retention is set 365 days or greater
Description
Ensure activity log retention is set for 365 days or greater.
Remediation
Perform the following in the Azure Console:
Go to Activity log
Click on Export
Set Retention (days) is set to 365 or 0
Select Save
Perform the following in Azure Command Line Interface 2.0:
Use the below command to set the Activity log Retention (days) to 365 or greater. az monitor log-profiles update –name <logProfileName> –setretentionPolicy.days=<number of days> retentionPolicy.enabled=true
Use the below command to store logs for forever (indefinitely). az monitor log-profiles update –name <logProfileName> –set retentionPolicy.days=0 retentionPolicy.enabled=false