Gallery › Resilience › Azure built-in policies
[Preview]: SQL Databases should be Zone Redundant
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0-preview Preview
SQL Databases can be configured to be Zone Redundant or not. Databases with the 'zoneRedundant' setting set to 'false' are not configured for zone redundancy. This policy helps identify SQL databases that need zone redundancy configuration to enhance availability and resilience within Azure.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONSql_servers_databases_ZoneRedundant_Audit.json · 63 lines
{
"properties": {
"displayName": "[Preview]: SQL Databases should be Zone Redundant",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "SQL Databases can be configured to be Zone Redundant or not. Databases with the 'zoneRedundant' setting set to 'false' are not configured for zone redundancy. This policy helps identify SQL databases that need zone redundancy configuration to enhance availability and resilience within Azure.",
"metadata": {
"category": "Resilience",
"version": "1.0.0-preview",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "This parameter lets you choose the effect of the policy. If you choose Audit (default), the policy will only audit resources for compliance. If you choose Deny, the policy will deny the creation of non-compliant resources. If you choose Disabled, the policy will not enforce compliance (useful, for example, as a second assignment to ignore a subset of non-compliant resources in a single resource group)."
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Sql/servers/databases"
},
{
"anyOf": [
{
"field": "Microsoft.Sql/servers/databases/elasticPoolId",
"exists": false
},
{
"field": "Microsoft.Sql/servers/databases/elasticPoolId",
"equals": ""
}
]
},
{
"field": "Microsoft.Sql/servers/databases/zoneRedundant",
"notEquals": "true"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/6221cac0-bb8d-40f4-9535-5d03f713f054",
"name": "6221cac0-bb8d-40f4-9535-5d03f713f054"
}Bylaw6221cac0-bb8d-40f4-9535-5d03f713f054.bylaw.ps1 · 36 lines
# Converted from Sql_servers_databases_ZoneRedundant_Audit.json by ConvertTo-Bylaw.
Policy '6221cac0-bb8d-40f4-9535-5d03f713f054' {
Properties @{
DisplayName = '[Preview]: SQL Databases should be Zone Redundant'
Description = 'SQL Databases can be configured to be Zone Redundant or not. Databases with the ''zoneRedundant'' setting set to ''false'' are not configured for zone redundancy. This policy helps identify SQL databases that need zone redundancy configuration to enhance availability and resilience within Azure.'
Category = 'Resilience'
Version = '1.0.0-preview'
Preview = $true
PolicyVersion = '1.0.0-preview'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'This parameter lets you choose the effect of the policy. If you choose Audit (default), the policy will only audit resources for compliance. If you choose Deny, the policy will deny the creation of non-compliant resources. If you choose Disabled, the policy will not enforce compliance (useful, for example, as a second assignment to ignore a subset of non-compliant resources in a single resource group).'
}
Resource 'Microsoft.Sql/servers/databases' {
When {
AnyOf {
Field elasticPoolId | Must -Not -Exist
Field elasticPoolId | Must -Be ''
}
}
Require 'zoneRedundant is true' {
Field zoneRedundant | Must -Be 'true'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Resilience/Sql_servers_databases_ZoneRedundant_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw