Skip to content

To run this script you will first need to use the parameters and template JSON files to deploy using the PS Script mentioned.

Notifications You must be signed in to change notification settings

andriikut/Automate-Alerts-Using-ARM-Templates

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Automate-Alerts-Using-ARM-Templates

Here is the description on how and why to use this script.

Have you ever had the tedious task of creating multiple alerts for all of the resources in your subscription? Let me tell you is really time consuming to create them from scratch one by one.

I have a PowerShell Script that can Target and Create specific metric alerts for the resources you define inside of the script. First make sure you have imported the following modules into PowerShell:

  • AzureRM
  • AzureRM.Insights

Next, lets create two JSON files, one will be parameters.json and the other template.json, lets put them in a local folder.

Now this portion of the code targets only Virtual Machines, but if you want to target additional resource types. Follow this link to view all the supported metrics for Azure Monitor, choose the resource type and metric and give all the desired changes inside of the script.

Change this line: $VMColl = Get-AzureRmResource -ResourceType "YOUR DESIRED RESOURCE" | Select-Object -Property ResourceId,Name

Supported Metrics and Resources: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric-near-real-time

Now let’s see the progress in real time!

After the script finishes go to the Deployments section of the resource group you defined, you will see each individual job being deployed.

To run this script you will first need to use the parameters and template JSON files to deploy using the PS Script mentioned.

About

To run this script you will first need to use the parameters and template JSON files to deploy using the PS Script mentioned.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published