0

Terraform を介してストレージ アカウントでメトリック アラートを作成しているときに、エラー 400 が発生します

ドキュメントを確認し、アラートの作成に使用している名前が正しいことを corss で確認しました

resource "azurerm_metric_alertrule" "test" {
name                = "alerttestacc"
resource_group_name = "${azurerm_resource_group.main.name}"
location            = "${azurerm_resource_group.main.location}"

description = "An alert rule to watch the metric Used capacity"

enabled = true

resource_id = "${azurerm_storage_account.to_monitor.id}"
metric_name = "UsedCapacity"
operator    = "GreaterThan"
threshold   = 20
aggregation = "Total"
period      = "PT5M"

email_action {
    send_to_service_owners = false

    custom_emails = [
    "xyz@gmail.com",
    ]
}

webhook_action {
    service_uri = "https://example.com/some-url"

    properties = {
        severity        = "incredible"
        acceptance_test = "true"
    }
}

想定: アラートを作成する必要があります

実際:

azurerm_metric_alertrule.test: Insights.AlertRulesClient#CreateOrUpdate: 要求への応答に失敗しました: StatusCode=400 -- 元のエラー: autorest/azure: サービスがエラーを返しました。Status=400 Code="UnsupportedMetric" Message="名前空間 '' および名前 'UsedCapacity' のメトリックは、このリソース ID ではサポートされていません

4

1 に答える 1