You have an Azure Key Vault named `kv-finance`.
You need to configure diagnostic logging for `kv-finance` to satisfy the following requirements:
- All key vault access logs (`AuditEvent`) must be queryable using KQL.
- The logs must be archived for 365 days to meet compliance regulations.
- Storage costs for the archived logs must be minimized.
Which configuration should you implement?
- Create a single diagnostic setting on `kv-finance` to send `AuditEvent` logs to a Log Analytics workspace and an Azure Storage account. Configure a lifecycle management policy on the storage account to delete data after 365 days.Answer
- BCreate a diagnostic setting on `kv-finance` to send `AuditEvent` logs to a Log Analytics workspace, and configure a 365-day retention period within the diagnostic setting.
- CCreate a diagnostic setting on `kv-finance` to send `AuditEvent` logs to an Azure Event Hub. Configure the event retention on the Event Hub namespace to 365 days.
- DCreate a diagnostic setting on `kv-finance` to send `AllMetrics` and `AuditEvent` logs to a Log Analytics workspace. Set the workspace default retention to 365 days.
Answer
Create a single diagnostic setting on the Key Vault to send the audit logs to both a Log Analytics workspace and an Azure Storage account, then configure a lifecycle management policy on the storage account to manage the 365-day retention.
The correct configuration uses a single diagnostic setting to send the logs to both the Log Analytics workspace (for queryability) and the Azure Storage account (for low-cost archiving). Since Azure Monitor diagnostic settings no longer support direct retention settings, configuring a lifecycle management policy on the storage account is the correct way to delete logs after 365 days.
Step-by-Step Solution
Key Concept
Azure Monitor diagnostic settings support routing resource logs to multiple destinations, including Log Analytics workspaces for querying and Storage accounts for cost-effective long-term retention using lifecycle management rules.