{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "policyAssignmentName": {
      "type": "string",
      "metadata": {
        "description": "Specifies the name of the policy assignment."
      }
    },
    "policyDefinitionID": {
      "type": "string",
      "metadata": {
        "description": "Specifies the ID of the policy definition or policy set definition being assigned."
      }
    },
    "location": {
      "type": "string",
      "metadata": {
        "description": "Specifies the resource location for system assigned identity of the policy assignment."
      }
    },
    "scope": {
      "type": "string",
      "defaultValue": "[subscription().id]",
      "metadata": {
        "description": "Specifies the scope of the where you want to assign the policy."
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.Authorization/policyAssignments",
      "name": "[parameters('policyAssignmentName')]",
      "apiVersion": "2018-05-01",
      "location": "[parameters('location')]",
      "identity": {
        "type": "SystemAssigned"
      },
      "properties": {
        "scope": "[parameters('scope')]",
        "policyDefinitionId": "[parameters('policyDefinitionID')]"
      }
    }
  ]
}