last sync: 2021-Jul-23 16:37:57 UTC

Azure Policy definition

SQL Database should avoid using GRS backup redundancy

Name SQL Database should avoid using GRS backup redundancy
Azure Portal
Id b219b9cf-f672-4f96-9ab0-f5a3ac5e1c13
Version 2.0.0
details on versioning
Category SQL
Microsoft docs
Description Databases should avoid using the default geo-redundant storage for backups, if data residency rules require data to stay within a specific region. Note: Azure Policy is not enforced when creating a database using T-SQL. If not explicitly specified, database with geo-redundant backup storage is created via T-SQL.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: Deny
Allowed: (Deny, Disabled)
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2021-04-27 15:38:15 change Major (1.0.1 > 2.0.0)
2021-02-10 14:43:58 change Patch (1.0.0 > 1.0.1) *changes on text case sensitivity are not tracked
2020-09-09 11:24:03 add b219b9cf-f672-4f96-9ab0-f5a3ac5e1c13
Used in Initiatives none
JSON Changes

JSON
{
  "properties": {
    "displayName": "SQL Database should avoid using GRS backup redundancy",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Databases should avoid using the default geo-redundant storage for backups, if data residency rules require data to stay within a specific region. Note: Azure Policy is not enforced when creating a database using T-SQL. If not explicitly specified, database with geo-redundant backup storage is created via T-SQL.",
    "metadata": {
      "version": "2.0.0",
      "category": "SQL"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Deny"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Sql/servers/databases"
          },
          {
            "field": "Microsoft.Sql/servers/databases/edition",
            "notEquals": "DataWarehouse"
          },
          {
            "anyOf": [
              {
                "allOf": [
                  {
                  "value": "[requestContext().apiVersion]",
                    "lessOrEquals": "2020-08-01-preview"
                  },
                  {
                    "not": {
                      "anyOf": [
                        {
                          "field": "Microsoft.Sql/servers/databases/storageAccountType",
                          "equals": "LRS"
                        },
                        {
                          "field": "Microsoft.Sql/servers/databases/storageAccountType",
                          "equals": "ZRS"
                        }
                      ]
                    }
                  }
                ]
              },
              {
                "allOf": [
                  {
                  "value": "[requestContext().apiVersion]",
                    "greater": "2020-08-01-preview"
                  },
                  {
                    "not": {
                      "anyOf": [
                        {
                          "field": "Microsoft.Sql/servers/databases/requestedBackupStorageRedundancy",
                          "equals": "Local"
                        },
                        {
                          "field": "Microsoft.Sql/servers/databases/requestedBackupStorageRedundancy",
                          "equals": "Zone"
                        }
                      ]
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/b219b9cf-f672-4f96-9ab0-f5a3ac5e1c13",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "b219b9cf-f672-4f96-9ab0-f5a3ac5e1c13"
}