0
votes

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.

1
The documentation says to use this to determine the available categories: terraform.io/docs/providers/azurerm/d/…Matt Schuchard

1 Answers

0
votes

As the error message said, Category 'WorkflowRuntime' is not supported. You could check supported log categories per resource type, no supported log category for VM. Also, There is a null output for using Data Source: azurerm_monitor_diagnostic_categories about VM.

Probably, you need to have version 3.0 or higher of the Linux Diagnostic extension installed on that VM in order to edit your diagnostic settings through the portal.

Reference: Linux diagnostic extension and Bootstrapping Azure VMs with Terraform