Monitoring and alerts
Every Revert deployment sends diagnostic logs to a Log Analytics workspace and creates Azure Monitor alert rules that email you about failed jobs, incomplete backups, drift, expiring certificates and unusual activity around credentials and recovery points.
Where logs go#
The Key Vault, the storage accounts, the jobs and the Function App (dashboard and API) send diagnostic logs to a Log Analytics workspace. By default the deployment creates it in the resource group, with 30-day retention.
To keep the audit trail outside the resource group, and therefore outside the reach of the identities that operate Revert, enter the resource ID of a workspace you own in Existing Log Analytics workspace (optional) on the deployment form. It keeps its own retention settings, and the alerts look only at this deployment's resources.
Cost#
Log Analytics charges for the data it ingests and retains. Storage read logging is the largest cost driver, because every comparison, restore and dashboard listing reads blobs, so it is off by default. Turn on Also log storage read operations on the deployment form only if you need a record of reads. See Azure Monitor pricing.
Important
An update applies the values on the deployment form for these two settings. When you update Revert, enter the same Existing Log Analytics workspace you used before (left blank, the update creates a new workspace) and set Also log storage read operations as it was.
Alerts that ship#
The deployment creates eleven rules. In Azure, each rule's name carries a prefix unique to the deployment, followed by the rule name below. All of them email the address in the action group that shares the same prefix. Severities run from 0 (Critical, the highest) to 4 (Verbose); the shipped rules use 1 (Error), 2 (Warning) and 3 (Informational).
The table gives the first step; Respond to an alert has the details.
| Rule | Severity | What it watches | What to do | Can be switched off |
|---|---|---|---|---|
failed-executions |
1 | A job execution fails or is refused: a backup, the scheduler or a fan-out. | Fix and rerun the job | Yes |
backup-deadline |
1 | A tenant's backup stops before writing its recovery point, having run out of time. | Open the job log for the tenant and resource type it reached | Yes |
backup-incomplete |
1 | A backup of any tenant finishes without one or more resource types. | Find the failed types in the job log | Yes |
drift |
2 | The scheduled daily verification finds differences between a tenant and its newest recovery point. | Review the drift report | Yes |
certificate-secret-read |
1 | An unexpected read of a tenant certificate's private key. | Treat as a possible credential exposure | No |
mass-blob-deletion |
1 | An unusually large number of blob deletions from the data storage account. | Find who deleted the blobs | No |
forged-principal-attempts |
2 | Repeated refused requests to the dashboard API. | Find the refused requests | No |
license-contact-stale |
2 | No contact with the licensing service for 7 days or more. | Restore contact | No |
cert-expiring |
3 | A backup or restore certificate is nearing expiry, or its Key Vault automatic renewal could not be turned off. | Rotate the certificate | Yes |
cert-expired |
1 | A backup or restore certificate has expired. | Rotate, or onboard again | No |
auth-mode-fallback |
3 | The dashboard API is missing part of its sign-in configuration. | Update Revert | No |
The six rules that cannot be switched off are security and recovery-at-risk signals; see Turn operational alerts off or on for the other five. Every rule resolves itself when its condition clears, and Azure Monitor sends a resolved notification. Most alerts arrive within about 15 minutes to an hour of the event; the certificate alerts follow your backup schedule.
Note
No alert ships for a recovery point that is overdue without a job failing. The dashboard's Overview and Needs attention list show overdue tenants.
Respond to an alert#
failed-executions: open Jobs, filter on Failed and open the job. The Operation log and any exception notice say what failed. Fix the cause and run the operation again.backup-deadline: a tenant's backup ran out of time before writing its recovery point, so that run produced nothing for the tenant. Open the job named on Jobs: its Operation log names the tenant and the resource type it had reached. Run the backup again; if it keeps missing its deadline for the same tenant, contact Vambris.backup-incomplete: a backup finished, but one or more resource types for a tenant could not be backed up, so that tenant's newest recovery point is missing them. The job can still show Completed, because every other type was saved. The alert covers every tenant, whether or not the tenant has its own alert recipient, and the email names the tenant. It also fires, alongsidefailed-jobs, when a tenant's whole backup fails.- Open Jobs and open the newest backup job. Its Operation log lists each resource type that failed, with the reason, and ends by naming the incomplete recovery points.
- On the Overview, the tenant's Protection shows Incomplete, and Needs attention lists the recovery point. Open it: Resource types names the types that failed, and each shows Not captured under Captured resources.
- Fix the cause, then select Run backup on Recovery points, or wait for the next scheduled backup. The alert resolves itself once the tenant's backups stop reporting failed types, and can stay fired for up to a day after a backup in which no type failed. While it is fired, a new failure for the same tenant is not emailed again: Needs attention on the Overview is where a repeat shows.
If the job ends Failed with a message that the backup-incomplete alert could not be raised, the backup could not report its failed types to Azure Monitor, so
failed-jobsemails you instead. The recovery points it wrote are kept; treat them as incomplete and follow the steps above.A very large tenant can need more memory than a backup job has. The log then shows an out-of-memory error for the largest types, such as Users and Groups, and running the backup again gives the same result: contact Vambris. Meanwhile, an older recovery point that holds those types can still be restored from.
drift: open Drift and review the tenant's newest report. Intended changes need nothing: the next backup captures them. Otherwise restore the affected objects. See Verify backups and detect drift.certificate-secret-read: a restore certificate can sign in with directory write access to an External ID tenant. Find who read it with the query below. If the read was not expected, rotate both certificates for the tenant (Operations > Certificate rotation > Rotate…, scope Backup + restore apps), which removes the old credential from the app, then review who has access to the Key Vault. If the alert fires on every scheduled backup, do not disable or mute it: contact Vambris.AZKVAuditLogs | where TimeGenerated > ago(2h) | where _ResourceId =~ "<key-vault-resource-id>" | where OperationName == "SecretGet" | project TimeGenerated, Identity, Id, ResultSignaturemass-blob-deletion: find who deleted the blobs with the query below. Recovery points inside the immutable window cannot be deleted by anyone. Blobs deleted outside it remain recoverable through blob versioning and soft delete (30 days by default). Do not disable the rule.StorageBlobLogs | where TimeGenerated > ago(2h) | where _ResourceId startswith "<data-storage-account-resource-id>" | where OperationName == "DeleteBlob" | summarize Deletions = count() by AuthenticationType, RequesterObjectId, CallerIpAddressforged-principal-attempts: list the refused requests with the query below. Each names the API route and whether the caller was unauthenticated or lacked the role. A user trying actions above their role can cause it; a stream of unauthenticated requests suggests someone probing the API. Refused requests change nothing.FunctionAppLogs | where TimeGenerated > ago(2h) | where _ResourceId startswith "<function-app-resource-id>" | where Message contains "unauthenticated request to" or Message contains "insufficient role for" | project TimeGenerated, Messagelicense-contact-stale: if the dashboard shows "An administrator needs to approve Revert's licensing app.", select Approve the licensing application. Otherwise allow outbound HTTPS from the Function App to the licensing service; see Network requirements. Without contact, onboarding pauses after 30 days and scheduled backups stop after 60; on-demand backups, restore, comparison and export are never affected. See Licensing and activation.cert-expiring: before it expires, rotate the certificate from Operations > Certificate rotation > Rotate…; see Rotate certificates. Backups keep running meanwhile. Do the same when the warning says Key Vault automatic renewal could not be turned off; the job log names the certificate. To change how early this warns, set Certificate warning threshold (days) under Configuration > Notifications.cert-expired: an expired backup certificate stops that tenant's scheduled backups; rotate it, which works while the restore certificate is still valid. An expired restore certificate makes restore and certificate rotation unavailable for that tenant, even though backups may look healthy: onboard the tenant again from Tenants, which issues new certificates. A tenant already on the dashboard can always be onboarded again, whatever the plan limit.auth-mode-fallback: the Function App's settings were changed outside Revert. Update Revert, which applies the missing setting again.
Change the alert email#
The Alert email you entered on the deployment form is the starting value. To change it (Admin role):
- In the dashboard, go to Configuration > Notifications.
- Enter the new address in Alert email.
- Optionally, change Certificate warning threshold (days) (1 to 90).
- Select Save changes.
Updates keep the address you set in the dashboard. Save changes also switches the operational alerts on if they were off.
Warning
Saving replaces every recipient of the deployment's alert action group with the one address, and every update does the same. Recipients you add to that action group in the Azure portal are removed. To reach several people, use a distribution list as the alert email, or add per-tenant recipients.
Turn operational alerts off or on#
Under Configuration > Notifications, select Disable or Enable (Admin
role). This switches failed-executions, backup-deadline, backup-incomplete,
drift, cert-expiring and every per-tenant backup-failure rule together. The other
six rules are not affected. Enable needs an alert email ("Set the alert email below
first."). While alerting is off and tenants are protected, Needs attention shows
Alerting is off. Updates keep your choice.
Per-tenant recipients#
A tenant can have its own alert recipient, in addition to the deployment-wide address:
- Go to Tenants and select Settings on the tenant's row.
- In the panel that opens (Protection for followed by the tenant), enter an address in Alert email.
- Select Save protection.
The dashboard then creates, in the resource group, an action group that emails only that
address and a severity 1 alert rule tagged eidgTenantId with the tenant ID. The rule
fires when a backup reports any failure for that tenant, and can stay fired for up to a
day after a later backup succeeds. The deployment-wide address is told about the same
failures by backup-incomplete, so a per-tenant recipient is in addition to it, never
instead. Problems with the whole deployment, such as a backup job that cannot start or
lost licensing contact, go only to the deployment-wide address.
Clearing the address, or offboarding the tenant, deletes both resources.
Add alerts for role and retention changes#
Two detections are worth adding and do not ship: role assignment changes on the
resource group, and changes to the storage lifecycle (retention) policy. Both are in the
Azure Activity Log, which reaches a workspace's AzureActivity table only through a
subscription-scope diagnostic setting, which the deployment cannot create.
Route the Activity Log to the workspace#
Once per subscription:
az monitor diagnostic-settings subscription create \
--name rvt-activity \
--location <region> \
--workspace <workspace-resource-id> \
--logs '[{"category":"Administrative","enabled":true},{"category":"Security","enabled":true}]'
Add the rules#
Create two log search alert rules on that workspace. Get the IDs to substitute with
az group show -n <resource-group> --query id -o tsv and
az storage account show -n <data-storage-account> --query id -o tsv.
Role assignment changed: someone granted or removed access on the resource group. Expect this only when you deploy or update Revert.
AzureActivity
| where OperationNameValue in~ (
"MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITE",
"MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/DELETE")
| where ActivityStatusValue =~ "Success"
| where tolower(_ResourceId) startswith tolower("<resource-group-id>")
Retention policy changed: the lifecycle policy that deletes old recovery points was written or deleted.
AzureActivity
| where OperationNameValue in~ (
"MICROSOFT.STORAGE/STORAGEACCOUNTS/MANAGEMENTPOLICIES/WRITE",
"MICROSOFT.STORAGE/STORAGEACCOUNTS/MANAGEMENTPOLICIES/DELETE")
| where ActivityStatusValue =~ "Success"
| where tolower(_ResourceId) startswith tolower("<data-storage-account-id>")
Saving retention or a tenant's protection settings, onboarding or offboarding a tenant,
and updating Revert also write the lifecycle policy and raise this alert. The Caller
in the Activity Log entry shows who made the change; dashboard changes come from the
Function App's managed identity.
Configure both rules to fire when the count of results is greater than 0, evaluated every 15 minutes over the last hour, and send them to the deployment's alert action group (its name starts the same way as the other rules'). Make a deliberate change and confirm that each query returns it before you rely on the rule.
