I have the following code to set up diagnostic settings for a VM. Terraform plan works ok and does not report any issues; however, I get the following error on apply:
Message="Category 'WorkflowRuntime' is not supported.".
I tried with AuditEvents and a couple of other categories and got the same error. Here is the code:
resource "azurerm_monitor_diagnostic_setting" "u_diag_settings" {
count = "${var.uCount}"
name = "${var.uName}${format("%1d", count.index+1)}-diag_setting"
target_resource_id = "${element(azurerm_virtual_machine.ubuntu.*.id, count.index)}"
log_analytics_workspace_id = "${data.azurerm_log_analytics_workspace.law_id.id}"
log {
category = "WorkflowRuntime"
enabled = "true"
retention_policy {
enabled = "true"
days = "30"
}
}
metric {
category = "AllMetrics"
enabled = "true"
retention_policy {
enabled = "true"
days = "30"
}
}
}
The target resource ID is a VM and I like to send the logs to a log analytics workspace. I'd appreciate any help.