The Wayback Machine - https://web.archive.org/web/20240930164809/https://www.geeksforgeeks.org/microsoft-azure-configuring-an-alert-rule-with-azure-monitor/
Open In App

Microsoft Azure – Configuring an Alert Rule with Azure Monitor

Last Updated : 30 Mar, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The azure monitor is a powerful monitoring tool that works like a smart dashboard for our applications and services by collecting application, guest operating system(OS), Azure resource, Azure subscription, and Azure tenant monitoring data to help us gain insights, understand the performance of our cloud and on-premise applications and services to easily identify issues that might affect them and know the factors and resources they depend on. 

It helps us gain application, virtual machines(VM), container insights, respond to critical situations, and metric thresholds set by us, using alert and auto-scale features. It also provides us with different options to visualize, integrate the data that is being monitored, and export it if required. 

Alerts in Azure monitor :

Alerts in Azure monitor uses the data collected by Azure monitor from our application and services to notify the administrators when an anomaly or issues based on certain thresholds are found. This helps us in taking the correct measure to fix the issue before the end-user gets to know about it. 

The key attributes of an alert in Azure Monitor are : 

  1. Target resource
  2. Criteria
  3. Signal
  4. Alert name
  5. Severity
  6. Alert description
  7. Action

Using these key attributes we can create an alert to notify us of different metrics and logs from the target resource we choose.

Creating alerts with Microsoft Azure portal :  

Azure portal is an easy-to-use web-based user interface that helps to create, manage, deploy and use Azure resources effectively.  

Prerequisites : 

You need to have an active Azure Subscription. You can avail of a free 12-month subscription from here.  

After you have signed in to your account follow the simple steps below to have your alerts ready :  

  • We will be on the Azure homepage. Click on Monitor which puts together all the data from applications and services with the monitoring settings in one view.

  • To create a new alert click the Alerts option and then click + New alert rule. 

  • Next, to select a target resource that we wish to be alerted on , click Select target. In the search bar, we can type the resource name to find it.

  • If the selected target resource has metrics we can create alerts on then available signals on the bottom right will include those metrics. This helps in choosing the right target resource as per our needs.

  • Once we have selected a target resource, click on the Add condition option to see a list of signals supported for the resource ( signals are of the following types: metric, activity log, Application Insights, and log). Select the metric we wish to create an alert on.
  • It will be default display a chart for the chosen metric of the target resource for the last six hours. If we wish to see a long history for the metric, we can use the chart period dropdown.  
  • Finally determine the logic that the metric alert rule will evaluate and get triggered by selecting the threshold type, operator, and aggregation type, threshold value/sensitivity based on the threshold type chosen.

  • Optionally, we can refine the alert condition more by adjusting other conditions like aggregation granularity and frequency of evaluation and then click on Done.
  • Optionally, we can add another criterion if we want to monitor a complex alert rule.
  • Fill in Alert details like alert rule name, description, and severity. Finally, Add an action group to the alert either by selecting an existing action group or creating a new action group which will define a specific action to be taken when the alert is fired. 
  • Click Done to save the metric alert rule.  

Your metric alert is ready to use. Now you will be alerted based on the threshold value set by you.  

Manage and View the Alert in Azure Portal : 

We can manage and view the Alert in Azure Monitor. This is how we can view and edit the created metric alerts:  

  • On the Azure homepage, click on Monitor.

  • Click on Alerts and Manage rules.  
  • In the Manage rules section, we can then view all our existing alert rules across subscriptions. We can further filter the rules using resource group, resource type, and resource.
  • Click on the name of the metric alert rule we wish to edit.
  • We can view our alert policy here. If we wish to edit a rule, click on the alert criteria we want to edit. We can then change the metric, threshold condition, and other fields as required except the alert rule name.
  • Click Done to save the edits.  

Congratulations! With a few steps, you learned what Azure Monitor, metric alerts are and how to use Azure monitor to create custom alerts.  

We can also create metric alerts using :  

  • Azure CLI
  • Azure Powershell
  • Rest API
  • Azure Resource Manager Templates

Previous Article
Next Article

Similar Reads

Microsoft Azure - Enable Azure Monitor VM Insights Agent For Azure VM
Azure Monitor VM Insights Agent enables you to get more visibility into the health and performance of your Azure VM. Here we'll see how we can enable Azure Monitor VM Insights to monitor the health, performance, and dependencies of azure virtual machines. Implementation: Follow the below steps to enable Azure Monitor VM insights agents for an Azure
2 min read
Microsoft Azure - Query Azure Storage Logs in Azure Monitor Log Analytics
Pre-requisite:- Azure Log Analytics is a tool offered by Azure, which is used to edit and run log queries against data in the Azure Monitor Logs store and helps interactively analyze their results. One can easily use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide various insi
5 min read
Microsoft Azure - Using Azure Monitor Workbooks
In this article, we will learn how to use Azure Monitor workbooks to get insights and visualize your data. Azure Monitor workbooks is a new visualization tool that’s available in the Azure portal. So, you’re familiar with the Azure portal and Monitor is something that’s always available and always on for all the Azure resources. Implementation: In
5 min read
Microsoft Azure - Using the Log Analytics Scope in Azure Monitor
Pre-requisite: Azure VM Log Analytics is a service in the Azure portal to enable monitoring and capturing logs of resources in a database for monitoring and analyzing results. It is also used to manage the agent's configuration across azure services. In this article, you will learn about how you can choose an Azure Log Analytics Workspace Scope in
2 min read
Microsoft Azure - Creating Action Rules With Azure Monitor
Pre-requisite:- Azure VM The Azure Monitor is one of the services offered by Microsoft Azure. As the name suggests, it is a kind of monitor which helps the user to maximize the availability and performance of the applications and services according to the needs of the user. It delivers a comprehensive solution for collecting, analyzing, and acting
4 min read
Microsoft Azure - Configuring Backup For Azure App Services
In this article, we will look into the process of configuring a backup for your Azure app servers and database. Follow the below steps to create a backup for your Azure Apps and databases: Step 1: Go to your application blade and type in "backups" and click on the Backups option. Step 2: Now, we'll click on configure, and in the backup configuratio
2 min read
Microsoft Azure - Configuring Log Analytics Data Retention
Log Analytics collects data from a variety of sources and uses a powerful query language to give you insights into the operation of your applications and resources. Log Analytics' cost depends on your choice of pricing tier, data retention, and which solutions are used. Let's see how we can change the retention days for Log Analytics Workspace. Let
1 min read
Microsoft Azure - Create Alert For Conditional Access Policy Changes
In this article, we will look into the process of creating an alert for Conditional Access Policy Changes. Conditional Access brings signals together, to make decisions, and enforce organizational policies. This alert detects :Creation of a New Conditional Access Policy,Deletion of a Conditional Access Policy,Changes to any current Conditional Acce
2 min read
Microsoft Azure - Setup Budget Alert and Configure Email Notification
Budgets Alert is a Cost Management tool in Microsoft Azure that helps you to get notified about your active azure subscription spending to proactively manage the costs of your azure resources which are being used. With these Azure budget alerts, you can track and monitor spending. This also helps to analyze the cost and to manage your budget to sav
2 min read
Microsoft Azure - Get Azure VM Properties using Azure PowerShell
The purpose of using the Azure PowerShell Commands is to quickly analyze the overall properties of VM/VMs at once the filtering the with select and where conditions. To find the properties of an Azure VM, you can perform the following commands in Azure Cloud Shell to get the details. Command: Get-AzVM Output: 1. Get all properties of an Azure Virtu
2 min read
Microsoft Azure - RDP to Azure Virtual Machines using Azure Bastion
In this article, we will learn how to do RDP(Remote Desktop Protocol) / SSH(Secure Shell) Connection to an Azure VM using Azure Bastion. First, let's discuss Azure Bastion. The Azure Bastion service is a fully platform-managed PaaS service that you provision inside your virtual network. It provides secure and seamless RDP/SSH connectivity to your v
3 min read
Microsoft Azure - Configure Azure SQL with Azure CLI
In this article, we're going to take a closer look at how you can configure something like connectivity using the Azure CLI. What we have here is we are in Azure Data Studio and similar to the SQL notebook we are actually using a PowerShell notebook. That just means all our code cells are going to run PowerShell and we are just connecting to localh
4 min read
Microsoft Azure - Get CPU Utilization Data of a Azure VM in Azure Portal
Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers. In this article, we will look into the process of getting the CPU Utilization data of an Azure VM in Azure Portal. Implementation: Follow the steps to get the CPU Utilization of an Azure VM in Azure Portal: Step 1: Log in to your Azure
2 min read
Microsoft Azure - Archive Azure VM to Azure Storage Account
In this article, we will be implementing a solution to archive a select azure VM snapshot to a select storage account for archiving using azure cloud shell. For implementation, we will be using Azure CLI commands. Prerequisite:VM SnapshotA storage account is neededUser needs "Storage Blob Contributor Data" IAM Role Access on Archiving Storage Accou
2 min read
Microsoft Azure - Check Status of Azure VM using Azure PowerShell
The following Azure PowerShell command helps you to find the Azure VM Config and properties details of Os Name, Os Version, Hyper V Generation, Disks properties, Extensions properties of Type Handler Version, Status and Message, VM Agents properties of Type Handler Version, Status and Message and also VM Power Status Codes, Messages, Plugins, Time
3 min read
Microsoft Azure - Azure VM Disk Space in Percentage using Azure KQL
Here we'll be using the Azure Insights Metric Query to find the free disk space in percentage using KQL. The purpose of this query is to find disk drive free space of all the Azure VMs without logging into every server. You can Run the following KQL log Queries in Azure Monitor or Azure VM Logs or Log Analytics Workspace. Note: VM Insights Agent sh
1 min read
Microsoft Azure - Azure CLI Commands to Manage Azure VMs
Azure Command-line interface is used to manage or to create Azure resources. By using the simple AZ CLI command we can manage Azure VM quickly and at a Scale. Let's get started by using a few important Azure CLI commands to manage Azure Virtual Machines. 1. Start a Specific Stopped VM in a Select Resource Group Use the below command to start a spec
2 min read
Microsoft Azure - Manage Azure VMs using Azure PowerShell Commands
Here we are using Azure PS Commands to manage azure resources from Azure Cloud Shell or by using Windows PowerShell. By using the simple AZ PS command we can manage Azure VM Quicks without any efforts of navigating in Azure Portal and at Scale. Let's get started by using the major Azure PS commands to manage Azure Virtual Machine. 1. Start a Specif
2 min read
Microsoft Azure - Install Azure Command Line Interface (Azure CLI)
Azure CLI is a very powerful tool that can be used to automate tasks, create, update, manage or delete azure resources or to troubleshoot problems with az module cmdlets. By installing az modules on your system or on your development system you and your development team can easily create, update or manage Azure AD and Azure resources such as manage
4 min read
Microsoft Azure- Backing Up, Restoring, and Cloning Microsoft Azure App Services
Microsoft is well known for developing relevant software which are using in today's time of technology to conquer the demand of users and developers to build up applications. In sequence of it Microsoft introduces Azure well known as Microsoft Azure to make quality applications. In this article, we will discuss Backing up, restoring and cloning Mic
8 min read
Microsoft Azure -Create a User in Microsoft Entra ID from Azure Portal
A user in Microsoft Entra ID is an individual who can get access to Azure identity. This Microsoft Entra ID identity can be used to access applications and resources that are protected within the organization or project. Users can be created manually or automatically, and they can be assigned to groups and roles to control their access permissions.
3 min read
Microsoft Azure- Disk Storage in Microsoft Azure
Azure Disk Storage is the only shared cloud block storage that supports both Windows and Linux-based clustered or high-availability applications via Azure shared disks. There are two types of Disks in Azure : Managed Disks Unmanaged Disks.Managed DisksSimplest optionLower management overhead as Azure manages the storage accounts.Only LRS replicatio
6 min read
Creating Dashboards With Azure Monitor Data
Pre-requisite: Track CPU Utilization of Azure Virtual Machines using KQL Log Query, and CPU and Memory Utilization of Azure VMs in a Single Table Chart In this article, you will see the process of creating a dashboard from the Azure portal with Azure Monitoring data or log data. You can use these dashboards to add azure resource logs data reports b
2 min read
How to Use Azure Monitor to Observe and Diagnose a JavaScript Error?
JavaScript is a very versatile language but still errors can occur, main to sudden conduct and personal dissatisfaction. Microsoft Azure offers an effective device referred to as Azure Monitor, which allows developers to identify, look at, and diagnose JavaScript errors effectively. In this text, we will explore how to use Azure Monitor to display,
7 min read
Configuring Single Sign-On (SSO) with Azure AD
Active Directory (AD) now known as Microsoft Entra ID is a database and set of services that connect users with the network resources they need to get their work done. The database (or directory) contains critical information about your environment, including what users and computers there are and who’s allowed to do what. For example, the database
4 min read
Configuring Network Settings for Azure VMs
Microsoft Azure virtual machines (VMs) provide scalable on-demand computing resources. Configuring the network settings of these virtual machines is important to ensure they communicate effectively and securely within your infrastructure. This article walks you through the basics and step-by-step procedures for setting up a network and provides exa
2 min read
Microsoft Azure - Azure Managed Disk State Details using PowerShell
In this article, we will try to understand how we can fetch the VM Disk State by using the Azure PowerShell Commands. With the help of the Azure PowerShell Commands, we will be finding the Managed Disk State of Unattached, Attached, and Reserved of all the Azure VM Disks within Subscription. Implementation: Follow the below steps to get azure manag
1 min read
Microsoft Azure - Introduction to Azure Digital Twins
In this article, we will learn how to get started with Azure Digital Twins. With Azure Digital Twins, you can model your real-world environment, including buildings, IoT sensors, and people to keep track of it, monitor it, and design it. Let's see how that works. First, we need to create an Azure Digital Twins service in Azure. Let's search for Dig
3 min read
Microsoft Azure - Enable Linux System Logs in Azure for Monitoring
Log Analytics is an Azure service that collects and stores information/data from a set of different sources and we can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide a variety of insights into our data. Enable and Collect Linux Syslog from Log Analytics agents at custom i
1 min read
Microsoft Azure - Enable Linux Performance Counters in Azure for Monitoring
Log Analytics is an Azure service that collects and stores information/data from a set of different sources and we can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide a variety of insights into our data. Collect Linux performance counters from Log Analytics agents at custo
1 min read