Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 Feature Request - Backup on SQL Virtual Machine #396

Open
naseemhira1196 opened this issue Sep 6, 2024 · 1 comment
Open

💡 Feature Request - Backup on SQL Virtual Machine #396

naseemhira1196 opened this issue Sep 6, 2024 · 1 comment
Labels
Area: Resource Graph Query(s) #️⃣ Related to ARG queries Area: Resource Guidance 📝 Improvements or additions to documentation Enhancement 🆕 New feature or request

Comments

@naseemhira1196
Copy link

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

@microsoft-github-policy-service microsoft-github-policy-service bot added the Enhancement 🆕 New feature or request label Sep 6, 2024
@ejhenry ejhenry added Area: Resource Guidance 📝 Improvements or additions to documentation Area: Resource Graph Query(s) #️⃣ Related to ARG queries labels Sep 11, 2024
@ejhenry
Copy link
Contributor

ejhenry commented Nov 23, 2024

@sethjiusa and @ramyerrabotu - please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Resource Graph Query(s) #️⃣ Related to ARG queries Area: Resource Guidance 📝 Improvements or additions to documentation Enhancement 🆕 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants