{ "properties": { "displayName": "SQLDBEncryption", "policyType": "Custom", "mode": "All", "description": "Test SQLDBEncryption-2108040050000993 ", "metadata": { "version": "2.0.0", "createdBy": "64fed97e-c52d-4ec6-9557-7d402529f183", "createdOn": "2021-10-07T06:57:20.6797944Z", "updatedBy": null, "updatedOn": null }, "parameters": {}, "policyRule": { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.Sql/servers/databases" }, { "field": "name", "notEquals": "master" } ] }, "then": { "effect": "DeployIfNotExists", "details": { "type": "Microsoft.Sql/servers/databases/transparentDataEncryption", "name": "current", "existenceCondition": { "anyOf": [ { "field": "Microsoft.Sql/transparentDataEncryption.status", "equals": "enabled" }, { "field": "Microsoft.Sql/servers/databases/transparentDataEncryption/state", "equals": "enabled" } ] }, "roleDefinitionIds": [ "/providers/microsoft.authorization/roleDefinitions/9b7fa17d-e63e-47b0-bb0a-15c516ac86ec" ], "deployment": { "properties": { "mode": "incremental", "template": { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "fullDbName": { "type": "string" } }, "resources": [ { "name": "[concat(parameters('fullDbName'), '/current')]", "type": "Microsoft.Sql/servers/databases/transparentDataEncryption", "apiVersion": "2014-04-01", "properties": { "status": "Enabled" } } ] }, "parameters": { "fullDbName": { "value": "[field('fullName')]" } } } } } } } }, "id": "/subscriptions/2f125ba4-2417-4ff3-aeee-44e794eaf4ce/providers/Microsoft.Authorization/policyDefinitions/c62f3126-46b3-491e-b61c-534ffd74bc32", "type": "Microsoft.Authorization/policyDefinitions", "name": "c62f3126-46b3-491e-b61c-534ffd74bc32", "systemData": { "createdBy": "almceyes@microsoft.com", "createdByType": "User", "createdAt": "2021-10-07T06:57:20.635464Z", "lastModifiedBy": "almceyes@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": "2021-10-07T06:57:20.635464Z" } }