{
  "properties": {
    "displayName": "Azure Media Services accounts that allow access to the legacy v2 API should be blocked",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "The Media Services legacy v2 API allows requests that cannot be managed using Azure Policy. Media Services resources created using the 2020-05-01 API or later block access to the legacy v2 API.",
    "metadata": {
      "version": "1.0.0",
      "category": "Media Services"
    },
    "parameters": {
      "effect": {
        "type": "string",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Media/mediaservices"
          },
          {
            "field": "Microsoft.Media/mediaservices/encryption.type",
            "exists": "false"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/ccf93279-9c91-4143-a841-8d1f21505455",
  "name": "ccf93279-9c91-4143-a841-8d1f21505455"
}
