Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Sql DB graph/powershell queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Dost Muhammad committed Oct 10, 2023
1 parent 5136015 commit 4607b02
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/content/services/database/sqldb/code/sqldb-1/sqldb-1.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
##Update-AzConfig -DisplayBreakingChangeWarning $false
$servers = Get-AzSqlServer
##Loop through all servers
foreach($server in $servers) {
$databases= Get-AzSqlDatabase -ServerName $server.ServerName -ResourceGroupName $server.ResourceGroupName
foreach($db in $databases) {
if ($db.CurrentBackupStorageRedundancy -eq 'Local' -or $db.CurrentBackupStorageRedundancy -eq 'Zone') {
Write-Host "recommendationId=SQLDB-1 SQLServerName=" $server.ServerName "databasename=" $db.DatabaseName "Redundancy=" $db.CurrentBackupStorageRedundancy
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// under-development
Resources
| where type =~ 'microsoft.sql/servers/databases'
| where tolower(tostring(properties.zoneRedundant))=~'false'
|project databaseId = id, databaseName = name, IszoneRedundant = tolower(tostring(properties.zoneRedundant)), recommendationId = "SQLDB-3"

0 comments on commit 4607b02

Please sign in to comment.