Microsoft.Insights/scheduledQueryRules does not respect skipQueryValidation flag
Hello,
I'm using terraform to deploy a log analytics workspace and an Azure Monitor log alert. However, I am running into an error when deploying the azurerm_monitor_scheduled_query_rules_alert_v2
resource.
I am getting the following error:
│ Error: creating Scheduled Query Rule (Subscription: "subscription-id"
│ Resource Group Name: "resource_group"
│ Scheduled Query Rule Name: "rule name"): unexpected status 400 (400 Bad Request) with error: BadRequest: 'where' operator: Failed to resolve table or column expression named 'table_name'. A semantic error occurred.. The request had some invalid properties Activity ID: <id>.
│
│ with module.functionapp.azurerm_monitor_scheduled_query_rules_alert_v2.monitor_name,
│ on ../modules/module/workspace.tf line 56, in resource "azurerm_monitor_scheduled_query_rules_alert_v2" "monitor_name":
│ 56: resource "azurerm_monitor_scheduled_query_rules_alert_v2" "monitor_name" {
│
│ creating Scheduled Query Rule (Subscription:
│ "<subscription-id>"
│ Resource Group Name: "resource_group"
│ Scheduled Query Rule Name: "rule_name"):
│ unexpected status 400 (400 Bad Request) with error: BadRequest: 'where'
│ operator: Failed to resolve table or column expression named│ 'table_name'. A semantic error occurred.. The request had some
│ invalid properties Activity ID: <>.
╵
A related thread with more info can be found here: https://github.com/hashicorp/terraform-provider-azurerm/issues/28293
I also directly tried using Microsoft.Insights/scheduledQueryRules from the azure/azapi provider, and the skipQueryValidation flag is not respected here, either. It seems to be an issue with the Azure API.
Can anyone help with this issue?