Question 34 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 34 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - You create the following PowerShell script:

$source = New-AzScheduledQueryRuleSource -Query ‘Heartbeat | where TimeGenerated > ago(1h)' -DataSourceld “contoso"

$schedule = New-AzScheduledQueryRuleSchedule -FrequencyInMinutes 60 -TimeWindowInMinutes 60

$triggerCondition = New-AzScheduledQueryRuleTriggerCondition -Threshold0perator “LessThan” -Threshold 5

$aznsActionGroup = New-AzScheduledQueryRuleAznsActionGroup -ActionGroup “contoso” -EmailSubject “Custom email subject”
-CustoniliebhookPayload "{ ‘“alert'":'"#alertrulename'", ‘"IncludeSearchResults'":true }"

SalertingAction = New-AzScheduledQueryRuleAlertingAction -AznsAction $aznsActionGroup -Severity "3" -Trigger $triggerCondition
New-AzScheduledQueryRule -ResourceGrouplame “contoso” -Location “eastus” -Action $alertingAction -Enabled $true

-Description “Alert description” -Schedule $schedule -Source $source -Name “Alert Name”

For each of the following statements, select Yes if the statement is true.

Otherwise, select No, NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

Statements

A log alert is created that sends an email when the CPU
percentage is above 60 percent for five minutes.

Alog alert is created that sends an email when the number of
virtual machine heartbeats in the past hour is less than five.

The log alert is scheduled to run every two hours.

Yes

Explanations

Answer Area

Statements Yes

A log alert is created that sends an email when the CPU °
percentage is above 60 percent for five minutes.

Alog alert is created that sends an email when the number of |e |
virtual machine heartbeats in the past hour is less than five.

The log alert is scheduled to run every two hours. °

Box 1: No - The AzScheduledQueryRuleSource is Heartbeat, not CPU.

Box 2: Yes - The AzScheduledQueryRuleSource is Heartbeat! Note: New-AzScheduledQueryRuleTriggerCondition creates an object of type Trigger Condition.

This object is to be passed to the command that creates Alerting Action object.

Box 3: No - The schedule is 60 minutes, not two hours.

-FrequencyInMinutes: The alert frequency.

-TimeWindowInMinutes: The alert time window The New-AzAscheduledQueryRuleSchedule command creates an object of type Schedule.

This object is to be passed to the command that creates Log Alert Rule.

https://docs.microsoft.com/en-us/powershell/module/az.monitor/new-azscheduledqueryrule https://docs.microsoft.com/en-us/powershell/module/az.monitor/new-azscheduledqueryruletriggercondition