无法找到具有无效数据源的 azure monitor 计划查询

Cant find azure monitor scheduled query with invalid data source

所以我正在使用 Terraform 创建针对特定应用程序洞察力的预定查询警报

resource "azurerm_template_deployment" "rule1" {
  name                = "queryrule${md5(format("%s-%s", var.resourcegroupname, var.name))}"  # This is the name of the deployment (has to be unique for each rule)
  resource_group_name = var.resourcegroupname
  template_body       = file("./modules/queryrule/queryRule.json")
  deployment_mode     = "Incremental"

  parameters = {
    action_emailSubject               = "${var.person} from ${var.email}"
    action_groups                     = "${join(";", var.action_group_array)}"
    action_trigger_thresholdOperator  = var.act_threshold_1operator
    action_trigger_threshold          = var.action_threshold
    name                              = var.name_rule
    description                       = var.description
    schedule_frequencyInMinutes       = var.frequency
    schedule_timeWindowInMinutes      = var.timeWindow
    query                             = var.queryString
    data_source_id                    = var.data_source
  }
}

queryRule.json 是一个正常的 ARM 模板,用于计划查询。

问题是,当我部署 terraform 项目时,数据源无效,因此创建了计划查询,但没有添加 appinsight 的警报,也没有添加到 terraform 状态。

当我下次部署时它说这个资源已经存在但不是 terraform 状态的一部分。我想删除这个预定查询,但我无法在 Azure 门户上找到它。关于如何查找和删除这个孤立的计划查询有什么想法吗?

已联系 Microsoft 支持以找到答案。我找不到它的原因是因为从未创建计划查询,只创建了它的部署并且没有添加到 Terraform 状态。我必须转到资源组菜单上的部署选项,找到失败的部署并将其删除。