Share via


Resource Manager-sjabloonvoorbeelden voor waarschuwingsregels voor Azure Monitor-activiteitenlogboeken (Beheer istratieve categorie)

Dit artikel bevat voorbeelden van Azure Resource Manager-sjablonen voor het maken en configureren van waarschuwingen voor activiteitenlogboeken voor Beheer istische gebeurtenissen in Azure Monitor.

Notitie

Zie Azure Resource Manager-voorbeelden voor Azure Monitor voor een lijst met voorbeelden die beschikbaar zijn en richtlijnen voor het implementeren ervan in uw Azure-abonnement.

Waarschuwingsregelvoorwaarde voor activiteitenlogboek voor de categorie Beheer istratieve gebeurtenis:

In dit voorbeeld wordt de voorwaarde ingesteld op de Beheer istratieve categorie:

"condition": {
          "allOf": [
            {
              "field": "category",
              "equals": "Administrative"
            },
            {
              "field": "resourceType",
              "equals": "Microsoft.Resources/deployments"
            }
          ]
        }
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "activityLogAlertName": {
      "type": "string",
      "metadata": {
        "description": "Unique name (within the Resource Group) for the Activity log alert."
      }
    },
    "activityLogAlertEnabled": {
      "type": "bool",
      "defaultValue": true,
      "metadata": {
        "description": "Indicates whether or not the alert is enabled."
      }
    },
    "actionGroupResourceId": {
      "type": "string",
      "metadata": {
        "description": "Resource Id for the Action group."
      }
    }
  },
  "resources": [   
    {
      "type": "Microsoft.Insights/activityLogAlerts",
      "apiVersion": "2017-04-01",
      "name": "[parameters('activityLogAlertName')]",      
      "location": "Global",
      "properties": {
        "enabled": "[parameters('activityLogAlertEnabled')]",
        "scopes": [
            "[subscription().id]"
        ],        
        "condition": {
          "allOf": [
            {
              "field": "category",
              "equals": "Administrative"
            },
            {
              "field": "operationName",
              "equals": "Microsoft.Resources/deployments/write"
            },
            {
              "field": "resourceType",
              "equals": "Microsoft.Resources/deployments"
            }
          ]
        },
        "actions": {
          "actionGroups":
          [
            {
              "actionGroupId": "[parameters('actionGroupResourceId')]"
            }
          ]
        }
      }
    }
  ]
}

Volgende stappen