You have an Azure SQL Database named `sqldb-sales`. You need to configure diagnostic logging to satisfy the following requirements:
- Send the SQL database audit logs (`SQLSecurityAuditEvents`) to a Log Analytics workspace named `law-security` for querying.
- Send the database performance metrics (`Basic`) to an Azure storage account named `stvalaudit` for long-term archiving.
- Minimize data ingestion costs by ensuring log data is not sent to the storage account and metric data is not sent to the Log Analytics workspace.
Which configuration should you implement?
- ACreate a single diagnostic setting that routes both `SQLSecurityAuditEvents` and `Basic` metrics to both the Log Analytics workspace and the storage account.
- BCreate a single diagnostic setting that routes `SQLSecurityAuditEvents` to the Log Analytics workspace, and configure the database backup settings to export performance metrics to the storage account.
- Create two separate diagnostic settings: one that routes `SQLSecurityAuditEvents` to the Log Analytics workspace, and another that routes `Basic` metrics to the storage account.Answer
- DCreate a single diagnostic setting routing all diagnostic data to the Log Analytics workspace, and configure an Azure Storage lifecycle management policy to copy metrics from the workspace to the storage account.
Answer
Create two separate diagnostic settings: one that routes the SQL database audit logs to the Log Analytics workspace, and another that routes the database performance metrics to the storage account.
A single Azure diagnostic setting routes all selected log categories and metrics to all configured destinations. To route audit logs (`SQLSecurityAuditEvents`) exclusively to the Log Analytics workspace and performance metrics (`Basic`) exclusively to the storage account without sending unwanted data to either destination, you must create two separate diagnostic settings. Azure resources support configuring up to 5 diagnostic settings.
Step-by-Step Solution
Key Concept
Routing different diagnostic logs and metrics to different destinations using multiple diagnostic settings.