How to ensure the diagnostic settings for storage accounts Azure policy is permanently enforced?
I tried the same in my environment but it seems complicated or not possible .AFAIK and also as mentioned in this Github Issue
, It is not possible to remediate the existing resources automatically.For diagnostics settings as it has deployifnotexists
effect, only the new resources get automatically remediated and existing resources have to be remediated manually or by PowerShell
or CLI
script.
So to automate the remediation , you can Run Scheduled Scripts using Task Schedulers
or Cron Jobs
or use Azure Automation scheduled Tasks
.