What are diagnostic settings and how do you enforce them at scale?
IntermediateConceptStorage, Key Vault and Monitoring
Answer
A diagnostic setting on a resource routes its resource logs and metrics to Log Analytics, storage, Event Hubs or a partner solution. Without one, most resource logs are simply not kept.
az monitor diagnostic-settings create -n to-law --resource <kvId> \
--workspace <lawId> --logs '[{"categoryGroup":"audit","enabled":true}]' \
--metrics '[{"category":"AllMetrics","enabled":true}]'
At scale, assign the built-in "Enable allLogs/audit category group resource logging to Log Analytics" policy initiatives (DeployIfNotExists) at management group scope.
More on Storage, Key Vault and Monitoring
What types of storage accounts and services exist?BeginnerWhat are the storage redundancy options?BeginnerExplain blob access tiers and lifecycle management.IntermediateWhat is a SAS token and what are the types?IntermediateHow do you lock down a storage account?IntermediateWhat protects blobs from accidental deletion?Intermediate