This message was deleted.
# azure
s
This message was deleted.
m
Hi Tim, Could you try to set the ApiVersion on the resource?
m
Hi Engin, Have tried with
Copy code
using MetricAlert = Pulumi.AzureNative.Insights.V20180301.MetricAlert;
using MetricAlertActionArgs = Pulumi.AzureNative.Insights.V20180301.Inputs.MetricAlertActionArgs;
and without, no luck unfortunately
m
I tired it too, ofc I have no real data, but it tries to create the resource:
Copy code
+   └─ azure-native:insights/v20180301:MetricAlert     metricAlert   **creating failed**             1 error


Diagnostics:
  pulumi:pulumi:Stack (ts-stuff-dev):
    error: update failed

  azure-native:insights/v20180301:MetricAlert (metricAlert):
    error: autorest/azure: Service returned an error. Status=403 Code="MultipleErrorsOccurred" Message="Multiple error occurred: Forbidden,Forbidden. Please see details." Details=[{"code":"LinkedAuthorizationFailed","message":"The client has permission to perform action 'microsoft.insights/webtests/read' on scope '/subscriptions/d62eb9ef-fe7c-45f5-8bd6-7b2b727869c4/resourceGroups/rg-example/providers/Microsoft.Insights/metricAlerts/webtest-name-example', however the linked subscription '12345678-1234-1234-1234-123456789101' was not found. "},{"code":"LinkedAuthorizationFailed","message":"The client has permission to perform action 'microsoft.insights/components/read' on scope '/subscriptions/d62eb9ef-fe7c-45f5-8bd6-7b2b727869c4/resourceGroups/rg-example/providers/Microsoft.Insights/metricAlerts/webtest-name-example', however the linked subscription '12345678-1234-1234-1234-123456789101' was not found. "}]

Resources:
    + 2 created
Can you maybe update the nugget packge of the azure-native provider to the latest
1.92.0
m
Tried with latest nugets but no luck, will need to park it for now and try again in a clean env next week
m
I will give it after my meeting a spin too in c#!
🙌 1
My code from above was ts
m
For ref my code is:
Copy code
new Pulumi.AzureNative.Insights.V20180301.MetricAlert("seq-traffic-alert", new()
        {
            Description = "Network traffic below threshold - instance possibly inaccessible",
            Enabled = true,
            Location = "Global",
            ResourceGroupName = resourceGroup.Id,
            Scopes = new[]
            {
                containerInstanceId
            },
        
            Actions = new[]
            {
                new Pulumi.AzureNative.Insights.V20180301.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = actionGroup.Id
                },
            },
            AutoMitigate = true,
            Severity = 1,
            EvaluationFrequency = "PT5M",
            WindowSize = "PT5M",
            Criteria = new Pulumi.AzureNative.Insights.V20180301.Inputs.MetricAlertSingleResourceMultipleMetricCriteriaArgs()
            {
                AllOf = new[]
                {
                    new Pulumi.AzureNative.Insights.V20180301.Inputs.MetricCriteriaArgs
                    {
                        Name = "networktraffic",
                        Threshold = 250,
                        MetricName = "NetworkBytesReceivedPerSecond",
                        MetricNamespace = "Microsoft.ContainerInstance/containerGroups",
                        Operator = "lessthan",
                        TimeAggregation = "Average",
        
                        CriterionType = "StaticThresholdCriterion",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
            },
        });
🙌 1
m
Ok, i can reproduce it in c#
I will create an issue for it, thanks for bringing this up
Hi @microscopic-furniture-52860, Can you change
ResourceGroupName = resourceGroup.Id
to
ResourceGroupName = resourceGroup.Name
please! Then it should work!
🙃 1
m
Doh, will give that a try later today! Thanks
439 Views