This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dost Muhammad
committed
Oct 10, 2023
1 parent
5136015
commit 4607b02
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
docs/content/services/database/sqldb/code/sqldb-1/sqldb-1.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |