'azure monitor script to list and configure alert rules
I have existing metrics and Log analytics query based alert rules , now i want to create additional bulk metrics and Log query based rules from powershell and API. Please suggest any script or API way to achieve this task.
Solution 1:[1]
azure monitor script to list and configure alert rules
View and manage Alert Rules in the Azure portal
In the Azure portal, select Monitor => Alerts => select Alert rules.
The list of available alert rules appears.
Filter or search for the activity log rule to modify.
Use the Set-AzAlertProcessingRule command to create alert processing rules.
Use Get-AzScheduledQueryRule to get all the Scheduled Query resources.
To Create Log Search rule it involves multiple PS cmdlets,Use New-AzScheduledQueryRule.
Solution 2:[2]
if your status varible named status then
<div className="msg" style={{display: status ? "block" : "none"}}>Message has been sent</div>
That's it.
And I suggest that you should add following code.
.catch(err => {
setValues({
name: "",
email: "",
message: "",
status: false
})
console.log(err);
window.alert("Email not sent")
});```
Solution 3:[3]
Wrapping the div between curly brackets, and add a condition && should do the work:
{values.status && <div className="msg">Message has been sent</div>}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | HarshithaVeeramalla-MT |
| Solution 2 | David Roadman |
| Solution 3 | maxpsz |
