Create Alert in Azure Monitor to Restart Virtual Machines | AZ-300 Exam Answer

Restart Virtual Machines when CPU Usage Exceeds 95% | AZ-300 Exam Answer

Question

You monitor Azure virtual machines by using Azure Monitor.

You plan to restart the virtual machines when CPU usage exceeds 95 percent for more than 30 minutes.

You need to create an alert in Azure Monitor to restart the virtual machines. The solution must minimize administrative effort.

Which type of action should you use in the alert?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C

Automation runbooks allows you to automatically perform standard remediations in response to VM alerts, like restarting or stopping the VM.

Previously, during VM alert rule creation you were able to specify an Automation webhook to a runbook in order to run the runbook whenever the alert triggered.

However, this required you to do the work of creating the runbook, creating the webhook for the runbook, and then copying and pasting the webhook during alert rule creation. With this new release, the process is much easier because you can directly choose a runbook from a list during alert rule creation, and you can choose an Automation account which will run the runbook or easily create an account.

https://azure.microsoft.com/en-us/blog/automatically-remediate-azure-vm-alerts-with-automation-runbooks/

The correct answer is C. Automation Runbook.

Azure Monitor allows you to create alerts based on metrics that are collected by Azure Monitor or based on logs in Log Analytics. In this case, the alert needs to be triggered when the CPU usage of the virtual machines exceeds 95 percent for more than 30 minutes. When this condition is met, the alert should execute an action to restart the virtual machines.

There are different types of actions that can be used in an alert in Azure Monitor, including ITSM, Webhook, Automation Runbook, and Logic App.

An ITSM action is used to create a ticket in an IT service management (ITSM) system, such as ServiceNow or System Center Service Manager. This action is useful when you want to notify IT staff to investigate an issue, but it does not automate the resolution of the issue.

A webhook action is used to call an external HTTP webhook, which can trigger an action in an external system, such as sending an email or SMS notification. This action is useful when you want to integrate Azure Monitor with external systems.

A Logic App action is used to trigger a Logic App workflow, which can automate a series of tasks or integrations. This action is useful when you want to automate the resolution of an issue using a Logic App.

An Automation Runbook action is used to trigger an Azure Automation runbook, which is a PowerShell script or a Python script that can automate the resolution of an issue. This action is useful when you want to automate the resolution of an issue using an Azure Automation runbook.

In this case, the requirement is to restart the virtual machines when the CPU usage exceeds 95 percent for more than 30 minutes. The Automation Runbook action is the most appropriate choice because it allows you to automate the resolution of the issue using an Azure Automation runbook. You can create an Azure Automation runbook that checks the CPU usage of the virtual machines and restarts them if the usage exceeds 95 percent for more than 30 minutes. Then, you can configure the Automation Runbook action in the alert to trigger the runbook when the condition is met.

Therefore, the correct answer is C. Automation Runbook.