Hello Danni,
You want to monitor Azure SQL Server backup retention policies. In the Azure portal’s alert wizard, you only see databases as resources, not the server-level retention policy. That’s expected behavior: Azure Monitor alerts are resource‑based, and the server object itself doesn’t expose backup retention as a metric or log category.
Retention policies for backups are configured at the server level. Azure Monitor alerts can be created only on resources that emit metrics/logs. The SQL server resource does not surface retention policy changes as a metric/log, so it won’t appear in the alert wizard. To monitor retention, you need to use Azure Policy rather than standard metric alerts.
To creating an Azure Policy for SQL server/database long‑term backup retention.
- Azure Policy Definitions
- In the Azure portal, search for Azure Policy in the search bar and select Azure Policy.
- In the Azure Policy pane, select Definitions on the left-hand side. This page will display all the policy definitions available in your environment.
- In the Search bar, type Audit SQL DB PITR backup retention or Audit SQL DB LTR backup retention to find the built-in policy definitions related to SQL backup retention. These built-in policies will audit the retention settings for SQL databases. Click on the Audit SQL DB PITR backup retention policy definition to see its details, including what the policy checks for.
- The Audit SQL DB PITR backup retention policy ensures that the Point-in-Time Restore backups are retained for the required period.
- The Audit SQL DB LTR backup retention policy does the same for Long-Term Retention backups.
- Assign the Policy to Your Subscription or Resource Group
- After selecting the policy, click Assign.
- Choose the scope where the policy should apply, such as a Subscription or a Resource Group.
- Select the SQL Server or SQL Databases you want to audit.
- Configure Parameters (if required), some policies might allow you to configure parameters, such as the retention period for PITR or LTR. Set these values as needed.
- Click Assign to apply the policy.
- Monitor and Track Compliance Once the policy is assigned, Azure Policy will continuously scan your SQL databases and check whether they comply with the defined retention periods for PITR and LTR backups. If a SQL database does not meet the required retention period, it will be marked as non-compliant.
- Set Up Policy Compliance Alerts:
- To receive alerts on the compliance state of your SQL databases, follow these steps:
- In the Azure portal, search for Azure Monitor and select the service.
- In Azure Monitor, select Alerts from the left-hand menu.
- Click + New Alert Rule
- Select the Scope: Under Scope, select the Subscription and Resource Group where the policy is applied.
- Set the Condition:
- Under Condition, click Add condition >Choose Policy compliance as the signal type >
- Select the policy definition you assigned earlier, such as Audit SQL DB PITR backup retention or Audit SQL DB LTR backup retention.
- Set the Compliance State to Non-compliant to trigger an alert whenever a database is found non-compliant.
- Define Action Group: Under Action Group, select or create an Action Group to define how you want to be notified (e.g., email, SMS, webhook).
- Set Alert Severity: Set the alert Severity level (Critical, Warning, or Informational).
- Review and Create: After reviewing the configuration, click Create to finalize the alert.
- Review Policy Compliance :
- Once the alert is set up, you can monitor Policy Compliance in the Azure Policy pane.
- Go to Azure Policy > Compliance.
- You will see how many resources are compliant or non-compliant with the SQL backup retention policies.
- The non-compliant databases will be listed, and you can investigate further or take corrective actions.
Hope this helps, thanks