This message was deleted.
# azure
s
This message was deleted.
f
Copy code
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,
        }
});
b
is it just that you've used {} instead of [] for scopes?
looks like it takes an array of strings not an object
oh sorry i'm thinking of typescript 😄
😀 1