|  | 
|  | 1 | +{ | 
|  | 2 | +  "parameters": { | 
|  | 3 | +    "subscriptionId": "dd4bfc94-a096-412b-9c43-4bd13e35afbc", | 
|  | 4 | +    "resourceGroupName": "QueryResourceGroupName", | 
|  | 5 | +    "ruleName": "perf", | 
|  | 6 | +    "api-version": "2022-06-15", | 
|  | 7 | +    "parameters": { | 
|  | 8 | +      "location": "eastus", | 
|  | 9 | +      "properties": { | 
|  | 10 | +        "description": "Performance rule", | 
|  | 11 | +        "severity": 4, | 
|  | 12 | +        "enabled": true, | 
|  | 13 | +        "evaluationFrequency": "PT5M", | 
|  | 14 | +        "scopes": [ | 
|  | 15 | +          "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" | 
|  | 16 | +        ], | 
|  | 17 | +        "windowSize": "PT10M", | 
|  | 18 | +        "criteria": { | 
|  | 19 | +          "allOf": [ | 
|  | 20 | +            { | 
|  | 21 | +              "query": "Perf | where ObjectName == \"Processor\"", | 
|  | 22 | +              "timeAggregation": "Average", | 
|  | 23 | +              "metricMeasureColumn": "% Processor Time", | 
|  | 24 | +              "resourceIdColumn": "resourceId", | 
|  | 25 | +              "dimensions": [ | 
|  | 26 | +                { | 
|  | 27 | +                  "name": "ComputerIp", | 
|  | 28 | +                  "operator": "Exclude", | 
|  | 29 | +                  "values": [ | 
|  | 30 | +                    "192.168.1.1" | 
|  | 31 | +                  ] | 
|  | 32 | +                }, | 
|  | 33 | +                { | 
|  | 34 | +                  "name": "OSType", | 
|  | 35 | +                  "operator": "Include", | 
|  | 36 | +                  "values": [ | 
|  | 37 | +                    "*" | 
|  | 38 | +                  ] | 
|  | 39 | +                } | 
|  | 40 | +              ], | 
|  | 41 | +              "operator": "GreaterThan", | 
|  | 42 | +              "threshold": 70, | 
|  | 43 | +              "failingPeriods": { | 
|  | 44 | +                "numberOfEvaluationPeriods": 1, | 
|  | 45 | +                "minFailingPeriodsToAlert": 1 | 
|  | 46 | +              } | 
|  | 47 | +            } | 
|  | 48 | +          ] | 
|  | 49 | +        }, | 
|  | 50 | +        "muteActionsDuration": "PT30M", | 
|  | 51 | +        "actions": { | 
|  | 52 | +          "actionGroups": [ | 
|  | 53 | +            "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" | 
|  | 54 | +          ], | 
|  | 55 | +          "customProperties": { | 
|  | 56 | +            "key11": "value11", | 
|  | 57 | +            "key12": "value12" | 
|  | 58 | +          } | 
|  | 59 | +        }, | 
|  | 60 | +        "autoMitigate": true, | 
|  | 61 | +        "checkWorkspaceAlertsStorageConfigured": true, | 
|  | 62 | +        "skipQueryValidation": true | 
|  | 63 | +      } | 
|  | 64 | +    } | 
|  | 65 | +  }, | 
|  | 66 | +  "responses": { | 
|  | 67 | +    "200": { | 
|  | 68 | +      "headers": {}, | 
|  | 69 | +      "body": { | 
|  | 70 | +        "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", | 
|  | 71 | +        "name": "perf", | 
|  | 72 | +        "type": "microsoft.insights/scheduledqueryrules", | 
|  | 73 | +        "location": "eastus", | 
|  | 74 | +        "tags": {}, | 
|  | 75 | +        "properties": { | 
|  | 76 | +          "description": "Performance rule", | 
|  | 77 | +          "severity": 4, | 
|  | 78 | +          "enabled": true, | 
|  | 79 | +          "evaluationFrequency": "PT5M", | 
|  | 80 | +          "scopes": [ | 
|  | 81 | +            "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" | 
|  | 82 | +          ], | 
|  | 83 | +          "windowSize": "PT10M", | 
|  | 84 | +          "criteria": { | 
|  | 85 | +            "allOf": [ | 
|  | 86 | +              { | 
|  | 87 | +                "query": "Perf | where ObjectName == \"Processor\"", | 
|  | 88 | +                "timeAggregation": "Average", | 
|  | 89 | +                "metricMeasureColumn": "% Processor Time", | 
|  | 90 | +                "resourceIdColumn": "resourceId", | 
|  | 91 | +                "dimensions": [ | 
|  | 92 | +                  { | 
|  | 93 | +                    "name": "ComputerIp", | 
|  | 94 | +                    "operator": "Exclude", | 
|  | 95 | +                    "values": [ | 
|  | 96 | +                      "192.168.1.1" | 
|  | 97 | +                    ] | 
|  | 98 | +                  }, | 
|  | 99 | +                  { | 
|  | 100 | +                    "name": "OSType", | 
|  | 101 | +                    "operator": "Include", | 
|  | 102 | +                    "values": [ | 
|  | 103 | +                      "*" | 
|  | 104 | +                    ] | 
|  | 105 | +                  } | 
|  | 106 | +                ], | 
|  | 107 | +                "operator": "GreaterThan", | 
|  | 108 | +                "threshold": 70, | 
|  | 109 | +                "failingPeriods": { | 
|  | 110 | +                  "numberOfEvaluationPeriods": 1, | 
|  | 111 | +                  "minFailingPeriodsToAlert": 1 | 
|  | 112 | +                } | 
|  | 113 | +              } | 
|  | 114 | +            ] | 
|  | 115 | +          }, | 
|  | 116 | +          "muteActionsDuration": "PT30M", | 
|  | 117 | +          "actions": { | 
|  | 118 | +            "actionGroups": [ | 
|  | 119 | +              "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" | 
|  | 120 | +            ], | 
|  | 121 | +            "customProperties": { | 
|  | 122 | +              "key11": "value11", | 
|  | 123 | +              "key12": "value12" | 
|  | 124 | +            } | 
|  | 125 | +          }, | 
|  | 126 | +          "autoMitigate": true, | 
|  | 127 | +          "isWorkspaceAlertsStorageConfigured": true, | 
|  | 128 | +          "checkWorkspaceAlertsStorageConfigured": true, | 
|  | 129 | +          "skipQueryValidation": true | 
|  | 130 | +        } | 
|  | 131 | +      } | 
|  | 132 | +    }, | 
|  | 133 | +    "201": { | 
|  | 134 | +      "headers": {}, | 
|  | 135 | +      "body": { | 
|  | 136 | +        "id": "/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf", | 
|  | 137 | +        "name": "perf", | 
|  | 138 | +        "type": "microsoft.insights/scheduledqueryrules", | 
|  | 139 | +        "location": "eastus", | 
|  | 140 | +        "tags": {}, | 
|  | 141 | +        "properties": { | 
|  | 142 | +          "description": "Performance rule", | 
|  | 143 | +          "severity": 4, | 
|  | 144 | +          "enabled": true, | 
|  | 145 | +          "evaluationFrequency": "PT5M", | 
|  | 146 | +          "scopes": [ | 
|  | 147 | +            "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1" | 
|  | 148 | +          ], | 
|  | 149 | +          "windowSize": "PT10M", | 
|  | 150 | +          "criteria": { | 
|  | 151 | +            "allOf": [ | 
|  | 152 | +              { | 
|  | 153 | +                "query": "Perf | where ObjectName == \"Processor\"", | 
|  | 154 | +                "timeAggregation": "Average", | 
|  | 155 | +                "metricMeasureColumn": "% Processor Time", | 
|  | 156 | +                "resourceIdColumn": "resourceId", | 
|  | 157 | +                "dimensions": [ | 
|  | 158 | +                  { | 
|  | 159 | +                    "name": "ComputerIp", | 
|  | 160 | +                    "operator": "Exclude", | 
|  | 161 | +                    "values": [ | 
|  | 162 | +                      "192.168.1.1" | 
|  | 163 | +                    ] | 
|  | 164 | +                  }, | 
|  | 165 | +                  { | 
|  | 166 | +                    "name": "OSType", | 
|  | 167 | +                    "operator": "Include", | 
|  | 168 | +                    "values": [ | 
|  | 169 | +                      "*" | 
|  | 170 | +                    ] | 
|  | 171 | +                  } | 
|  | 172 | +                ], | 
|  | 173 | +                "operator": "GreaterThan", | 
|  | 174 | +                "threshold": 70, | 
|  | 175 | +                "failingPeriods": { | 
|  | 176 | +                  "numberOfEvaluationPeriods": 1, | 
|  | 177 | +                  "minFailingPeriodsToAlert": 1 | 
|  | 178 | +                } | 
|  | 179 | +              } | 
|  | 180 | +            ] | 
|  | 181 | +          }, | 
|  | 182 | +          "muteActionsDuration": "PT30M", | 
|  | 183 | +          "actions": { | 
|  | 184 | +            "actionGroups": [ | 
|  | 185 | +              "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup" | 
|  | 186 | +            ], | 
|  | 187 | +            "customProperties": { | 
|  | 188 | +              "key11": "value11", | 
|  | 189 | +              "key12": "value12" | 
|  | 190 | +            } | 
|  | 191 | +          }, | 
|  | 192 | +          "autoMitigate": true, | 
|  | 193 | +          "isWorkspaceAlertsStorageConfigured": true, | 
|  | 194 | +          "checkWorkspaceAlertsStorageConfigured": true, | 
|  | 195 | +          "skipQueryValidation": true | 
|  | 196 | +        } | 
|  | 197 | +      } | 
|  | 198 | +    } | 
|  | 199 | +  } | 
|  | 200 | +} | 
0 commit comments