fancy-nightfall-60106
09/01/2020, 1:33 PMWebTest
- according to https://docs.microsoft.com/en-us/rest/api/monitor/metricalerts/createorupdate#create-or-update-a-web-test-alert-rule it looks like it doesn't need a scopes
-property, but Pulumi requires that Scopes
is not empty.
Settings scopes to ApplicationInsightsId failes with:
Alert scope is invalid
Not settings Scopes failes with:
Pulumi.Azure.Monitoring.MetricAlertArgs._scopes is required but was not given a value (Parameter '_scopes')
Any ideas?
Sample code in thread.var insightsId = "<id to azure resource>";
var testname = "mywebtestalert";
var webtest = new WebTest(...);
_ = new MetricAlert(testname, new MetricAlertArgs()
{
ResourceGroupName = ResourceGroupName,
Name = testname,
Scopes =
{
insightsId
},
Description = $"Use {testname} to monitor {name}",
ApplicationInsightsWebTestLocationAvailabilityCriteria =
new MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs()
{
ComponentId = insightsId,
FailedLocationCount = 2,
WebTestId = webtest.Id,
}
});
better-rainbow-14549
09/02/2020, 1:08 PM