70-473 · Question #108
Your company has a Microsoft Azure SQL database named OBI. You create an alert in DB1. You need to ensure that an Azure PowerShell script named alerts.psl runs when the alert is triggered. What…
The correct answer is C. Add alerts.psl to a runbook. Create a webhook to start the runbook. To run an Azure PowerShell script when an Azure SQL database alert is triggered, add the script to an Azure Automation runbook and configure the alert to start the runbook via a webhook.
Question
Options
- AAdd alerts.psl to Azure Blob storage.
- BAdd alerts.psl to a new Azure virtual machine named VM2.
- CAdd alerts.psl to a runbook. Create a webhook to start the runbook.
- DAdd alerts.psl to a runbook. Create an Azure automation job to start the runbook.
How the community answered
(28 responses)- A14% (4)
- B7% (2)
- C75% (21)
- D4% (1)
Why each option
To run an Azure PowerShell script when an Azure SQL database alert is triggered, add the script to an Azure Automation runbook and configure the alert to start the runbook via a webhook.
Adding the script to Azure Blob storage merely stores the script file and does not provide any mechanism to execute it in response to an Azure SQL database alert.
Adding the script to an Azure virtual machine (VM2) would require configuring the VM to monitor the alert and execute the script, which is a less integrated and more complex solution than using Azure Automation runbooks.
To run an Azure PowerShell script in response to an Azure SQL database alert, the script should be added to an Azure Automation runbook. The alert's action group can then be configured to invoke a webhook, which serves as an HTTP endpoint to start the runbook automatically when the alert is triggered.
While the script would be in a runbook, an Azure alert does not directly create an "Azure automation job to start the runbook"; instead, the alert's action group typically triggers the runbook via a webhook, which then initiates an automation job for that specific runbook execution.
Concept tested: Azure Monitor alerts and Azure Automation
Source: https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups
Topics
Community Discussion
No community discussion yet for this question.