I am successfully deploying an Azure Data Factory instance and enabling Diagnostic Settings for Azure Monitor and Log Analytics using Terraform. In the Azure Portal I can see that, for Data Factory, one can select the destination table where data will be stored in Log Analytics: either "Azure Diagnostics" or "Resource Specific", which seems to be recommended.
By default, the "Azure diagnostics" option is set.
How can I set the destination table to "Resource specific" in my Terraform code? I could not find anything in the documentation indicating how to do so.
Here is my code:
# Azure Data Factory diagnostic settings
resource "azurerm_monitor_diagnostic_setting" "edp_adf" {
name = azurerm_data_factory.edp.name
target_resource_id = azurerm_data_factory.edp.id
log_analytics_workspace_id = data.azurerm_log_analytics_workspace.cloud_services.id
log {
category = "ActivityRuns"
enabled = true
retention_policy {
enabled = true
days = 31
}
}
log {
category = "PipelineRuns"
enabled = true
retention_policy {
enabled = true
days = 31
}
}
log {
category = "TriggerRuns"
enabled = true
retention_policy {
enabled = true
days = 31
}
}
metric {
category = "AllMetrics"
retention_policy {
enabled = true
days = 7
}
}
}