Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource Specific destination table for Azure Data Factory diagnostic settings using Terraform

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.

enter image description here

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
    }
  }
}
like image 514
Antonio González Mirón Avatar asked Dec 15 '25 14:12

Antonio González Mirón


1 Answers

This is indeed possible now with the azurerm provider version 1.33.0

Just add:

log_analytics_destination_type = "Dedicated"

to the Terraform code shown in the question.

like image 142
Antonio González Mirón Avatar answered Dec 18 '25 23:12

Antonio González Mirón



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!