💡 Feature Request - Backup on SQL Virtual Machine #396
Labels
Area: Resource Graph Query(s) #️⃣
Related to ARG queries
Area: Resource Guidance 📝
Improvements or additions to documentation
Enhancement 🆕
New feature or request
Current script does not check for this, and I missed it for one of my customers which is not good for both customer and Microsoft. Please consider adding this query that checks for SQL virtual machine backup into the APRL script:
resources
| where type == "microsoft.sqlvirtualmachine/sqlvirtualmachines"
| project name, id, resourceGroup
| join kind=leftouter (
recoveryservicesresources
| where type =~ "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"
| where properties.dataSourceInfo.datasourceType =~ "SQLDataBase"
| project isBackedupByRSV=properties.sourceResourceId
| extend name=strcat_array(array_slice(split(isBackedupByRSV, "/"), 8, -1), "/")
) on name
| extend isBackedupByRSV = iff(isBackedupByRSV startswith "/subscriptions","True","False")
| distinct *
| join kind=leftouter (
resources
| where type == "microsoft.compute/virtualmachines/extensions"
| where name == "SqlIaasExtension"
| project isAutoBackedUp=properties.settings.AutoBackupSettings.Enable ,id
| extend name=strcat_array(array_slice(split(id, "/"), 8, -3), "/")
) on name
| extend isAutoBackedUp = iff(isAutoBackedUp =~ "true", "True", "False")
| join kind=leftouter (
resources
| where type == "microsoft.compute/virtualmachines"
| project name, PowerStatus = properties.extended.instanceView.powerState.displayStatus
) on name
| project id, resourceGroup, isBackedupByRSV, isAutoBackedUp, PowerStatus
The text was updated successfully, but these errors were encountered: