This solution aligns with the Azure Monitor Baseline Alerts (AMBA) guidelines for Azure Virtual Desktop (AVD). While the baseline alerts can be deployed using the provided ARM JSON templates, this repository showcases how to achieve the same objectives with Terraform. The emphasis is on a Terraform-first approach, delivering modularity, reusability, and stateful management for your alerting infrastructure.
This solution creates following alert rules. For a AVD deployment with single host pool and single storage account for FSLogix, this solution will create 47 alert rules.
| Name | Threshold(s) (Severity) | Signal Type | Frequency | # Alert Rules |
|---|---|---|---|---|
| AVD-HostPool-VM-Available Memory Less Than nGB (hostpoolname) | 1gb (Sev1) / 2gb (Sev2) | Metric Alerts | 5 min | 2/hostpool |
| AVD-HostPool-VM-High CPU nn Percent (hostpoolname) | 95 (1) / 85 (2) | Metric Alerts | 5 min | 2/hostpool |
| AVD-HostPool-VM-OS Disk Bandwidth Avg n% (hostpoolname) | 95 (1) / 85 (2) | Metric Alerts | 5 min | 2/hostpool |
| AVD-Storage-Over XXms Latency for Storage Act-{storacctname} | 100ms / 50ms | Metric Alerts | 15 min | 2/stor acct |
| AVD-Storage-Over XXms Latency Between Client-Storage-{storacctname} | 100ms / 50ms | Metric Alerts | 15 min | 2/stor acct |
| AVD-Storage-Possible Throttling Due to High IOPs-{storacctname} (2.) | (1) | Metric Alerts | 15 min | 1/stor acct |
| AVD-Storage-Azure Files Availability-{storacctname} | 99 / na | Metric Alerts | 5 min | 1/stor acct |
| AVD-HostPool-Capacity (1.) | 95% (1) / 85% (2) / 50% (3) | Log Analytics | 5 min | 3/hostpool |
| AVD-HostPool-Disconnected User over n Hours (hostpoolname) | 24 (1) / 72 (2) | Log Analytics | 1 hour | 2/hostpool |
| AVD-HostPool-No Resources Available (hostpoolname) | Any are Sev1 | Log Analytics | 15 min | 1/hostpool |
| AVD-HostPool-VM-FSLogix Profile DiskCompactFailed (hostpoolname) | (2) | Log Analytics | 5 min | 1/hostpool |
| AVD-HostPool-VM-FSLogix Profile FailedAttachVHD (hostpoolname) | (1) | Log Analytics | 5 min | 1/hostpool |
| AVD-HostPool-VM-FSLogix Profile Less Than n% Free Space (hostpoolname) | 2% (1) / 5% (2) | Log Analytics | 5 min | 2/hostpool |
| AVD-HostPool-VM-FSLogix Profile Failed due to Network Issue (hostpoolname) | (1) | Log Analytics | 5 min | 1/hostpool |
| AVD-HostPool-VM-FSLogix Profile Service Disabled (hostpoolname) | (1) | Log Analytics | 5 min | 1/hostpool |
| AVD-HostPool-VM-Health Check Failure (hostpoolname) | (1) | Log Analytics | 5 min | 1/hostpool |
| AVD-HostPool-VM-Local Disk Free Space n% (hostpoolname) | 5 (1) / 10 (2) | Log Analytics | 15 min | 2/hostpool |
| AVD-HostPool-VM-Personal Assigned Not Healthy (hostpoolname) | Any are Sev 1 | Log Analytics | 5 min | 1/hostpool |
| AVD-HostPool-VM-User Connection Failed (hostpoolname) | Any are Sev 3 | Log Analytics | 15 min | 1/hostpool |
| AVD-HostPool-VM-Missing Critical Updates (hostpoolname) | Any are Sev 1 | Log Analytics | 1 day | 1/hostpool |
| AVD-Storage-Low Space on Azure File Share-X% Remaining-{volumename} (1.) | 5 / 15 | Log Analytics | 1 hour | 2/share |
| AVD-ServiceHealth-Health Advisory | na | Service Health | na | 4 |
| AVD-ServiceHealth-Planned Maintenance | na | Service Health | na | 4 |
| AVD-ServiceHealth-Security | na | Service Health | na | 4 |
| AVD-ServiceHealth-Service Issue | na | Service Health | na | 4 |
- Terraform v1.x and azurerm provider (pin to a tested version).
- Azure subscription and contributor rights for resources created.
- Storage with Azure Files configured for FSLogix Profiles.
- Existing AVD Host Pools with AVD Insights configured per AVD Portal’s AVD Insights Configuration workbook.
- Log Analytics Workspace for AVD with diagnostics enabled per the configuration workbook.
- Host Pool Diagnostics enabled
- Workspace Diagnostics enabled
- Data Collection Rule associated with the Log Analytics Workspace
Alerts are created disabled by default to match upstream guidance; enabling is a separate step.
Log-based alerts (Kusto queries) are implemented with azurerm_monitor_scheduled_query_rules_alert.
Metric alerts use azurerm_monitor_metric_alert.
Service Health alerts are surfaced where supported; note some service-health alert types may require Azure Portal or API features not fully covered by Terraform providers—validate provider support in your target azurerm version. azure.github.io