An Azure service that automates the access and use of data across clouds without writing code.
Use the common alert schema and pass the server name from the Log Analytics alert into the Logic App, then read it from the alert payload in the email action.
- In the Log Analytics alert rule, extend the query to calculate the server name and project it as a column:
AddonAzureBackupJobs | where JobFailureCode == "Success" | extend ServerName = tostring(split(BackupItemUniqueId, ";")[-2]) | project TimeGenerated, ServerName, JobStatus, JobFailureCode - When creating the action group that calls the Logic App:
- On the Actions tab, choose Logic App as the action type.
- Select the Logic App.
- Set Enable common alert schema to Yes.
- In the Logic App:
- Use the When an HTTP request is received trigger (created automatically when the action group is configured to call the Logic App).
- No custom request body schema is required; the common alert schema payload is sent automatically.
- Add a Send an email (V2) action under Office 365 Outlook:
- In Subject and Body, use dynamic content from the alert payload. The server name is available under the alert context because it was projected in the query. For example, in the body:
-
Server backed up: data.alertContext.ServerName
-
- Optionally include other fields such as
alertRule,severity,monitorCondition,firedDateTime, andalertTargetIDsas shown in the Logic Apps email example.
- In Subject and Body, use dynamic content from the alert payload. The server name is available under the alert context because it was projected in the query. For example, in the body:
With this setup, every time the alert fires for a successful backup, the Logic App receives the alert payload (including ServerName) and sends an email where the subject/body contains the server name.
References: