Monitor Azure Virtual Machine Power State Changes | Azure Exam AZ-100

Receive Email Notifications for Virtual Machine Power State Changes

Question

You have an Azure subscription that contains 10 virtual machines.

You need to ensure that you receive an email message when any virtual machines are powered off, restarted, or deallocated.

What is the minimum number of rules and action groups that you require?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C

An action group is a collection of notification preferences defined by the user. Azure Monitor and Service Health alerts are configured to use a specific action group when the alert is triggered. Various alerts may use the same action group or different action groups depending on the user's requirements.

https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-action-groups

The correct answer is option B: one rule and one action group.

To receive an email message when any virtual machines are powered off, restarted, or deallocated, you can use Azure Monitor to create an alert rule and associate it with an action group that sends email notifications.

To create the rule, follow these steps:

  1. In the Azure portal, navigate to the Virtual Machines blade and select the virtual machines you want to monitor.

  2. Click on the "Alerts" tab and then click the "+ New alert rule" button.

  3. In the "Create rule" blade, select the appropriate resource group and resource type (in this case, Virtual Machines).

  4. In the "Condition" section, click on the "Add condition" button and select the "Virtual Machine" category.

  5. From the "Virtual Machine" category, select the "Status" signal and choose the values "PowerState/running" and "PowerState/deallocated" to trigger the alert rule when any virtual machine is powered off or deallocated.

  6. In the "Actions" section, click on the "Add action group" button and create a new action group that sends email notifications. In the action group, specify the email addresses of the recipients and configure the notification settings (such as the subject and body of the email message).

  7. In the "Alert rule details" section, give the rule a name and description, and configure the frequency and severity of the alerts.

By following these steps, you can create a single alert rule and associate it with an action group that sends email notifications when any of the specified virtual machines are powered off, restarted, or deallocated. Therefore, the minimum number of rules and action groups required to achieve this is one.