Bylaw

Gallery › App Configuration › Azure Community Policy

App Configuration stores should should have soft delete enabled of 7 days

Doesn't convert yet Policy Audit Deny Disabled Mode All Version 1.0.0

Deleting a App Configuration store without soft delete enabled permanently deletes all data it contains

ConvertTo-Bylaw can't convert this policy yet:

Azure Policy JSONazurepolicy.json · 66 lines
{
  "name": "3557ee6d-ff74-49a7-8684-b0c83ce44bed",
  "type": "Microsoft.Authorization/policyDefinitions",
  "properties": {
    "displayName": "App Configuration stores should should have soft delete enabled of 7 days",
    "description": "Deleting a App Configuration store without soft delete enabled permanently deletes all data it contains",
    "metadata": {
      "version": "1.0.0",
      "category": "App Configuration"
    },
    "mode": "All",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Deny, Audit or Disabled the execution of the Policy"
        },
        "allowedValues": [
          "Deny",
          "Audit",
          "Disabled"
        ],
        "defaultValue": "Audit"
      },
      "softDeleteValue": {
        "type": "int",
        "metadata": {
          "displayName": "Retention in days",
          "description": "Value to set the Soft Delete retention in days"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.AppConfiguration/configurationStores"
          },
          {
            "not": {
              "field": "Microsoft.AppConfiguration/configurationStores/createMode",
              "equals": "recover"
            }
          },
          {
            "anyOf": [
              {
                "field": "Microsoft.AppConfiguration/configurationStores/softDeleteRetentionInDays",
                "exists": "false"
              },
              {
                "field": "Microsoft.AppConfiguration/configurationStores/softDeleteRetentionInDays",
                "notequals": "[parameters('softDeleteValue')]"
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    }
  }
}

Source: policyDefinitions/App Configuration/app-configuration-stores-should-should-have-soft-delete-enabled-of-7-days/azurepolicy.json in Azure/Community-Policy, under the MIT licence.