Microsoft.Insights/scheduledQueryRules does not respect skipQueryValidation flag

Anita Ma 0 Reputation points Microsoft Employee
2025-03-13T06:09:25.3233333+00:00

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?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,507 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.