Activity Log Alerts - List By Resource Group

Get a list of all activity log alerts in a resource group.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts?api-version=2017-04-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True
  • string

The name of the resource group.

subscriptionId
path True
  • string

The Azure subscription Id.

api-version
query True
  • string

Client Api Version.

Responses

Name Type Description
200 OK

The request succeeded.

Other Status Codes

An error occurred and the list of activity log alerts could not be retrieved.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

List activity log alerts

Sample Request

GET https://management.azure.com/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ActivityLogAlerts/providers/microsoft.insights/activityLogAlerts?api-version=2017-04-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ActivityLogAlerts/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlert",
      "type": "Microsoft.Insights/ActivityLogAlerts",
      "name": "SampleActivityLogAlert",
      "location": "Global",
      "tags": {},
      "properties": {
        "scopes": [
          "subscriptions/187f412d-1758-44d9-b052-169e2564721d"
        ],
        "enabled": true,
        "condition": {
          "allOf": [
            {
              "field": "Category",
              "equals": "Administrative"
            },
            {
              "field": "Level",
              "equals": "Error"
            }
          ]
        },
        "actions": {
          "actionGroups": [
            {
              "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ActionGroups/providers/microsoft.insights/actionGroups/SampleActionGroup",
              "webhookProperties": {
                "sampleWebhookProperty": "samplePropertyValue"
              }
            }
          ]
        },
        "description": "Sample activity log alert description"
      }
    },
    {
      "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ActivityLogAlerts/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlert2",
      "type": "Microsoft.Insights/ActivityLogAlerts",
      "name": "SampleActivityLogAlert2",
      "location": "Global",
      "tags": {},
      "properties": {
        "scopes": [
          "subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ActivityLogAlerts"
        ],
        "enabled": true,
        "condition": {
          "allOf": [
            {
              "field": "Category",
              "equals": "Administrative"
            }
          ]
        },
        "actions": {
          "actionGroups": [
            {
              "actionGroupId": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ActionGroups/providers/microsoft.insights/actionGroups/SampleActionGroup",
              "webhookProperties": {}
            }
          ]
        }
      }
    }
  ]
}

Definitions

ActivityLogAlertActionGroup

A pointer to an Azure Action Group.

ActivityLogAlertActionList

A list of activity log alert actions.

ActivityLogAlertAllOfCondition

An Activity Log alert condition that is met when all its member conditions are met.

ActivityLogAlertLeafCondition

An Activity Log alert condition that is met by comparing an activity log field and value.

ActivityLogAlertList

A list of activity log alerts.

ActivityLogAlertResource

An activity log alert resource.

ErrorResponse

Describes the format of Error response.

ActivityLogAlertActionGroup

A pointer to an Azure Action Group.

Name Type Description
actionGroupId
  • string

The resourceId of the action group. This cannot be null or empty.

webhookProperties
  • object

the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.

ActivityLogAlertActionList

A list of activity log alert actions.

Name Type Description
actionGroups

The list of activity log alerts.

ActivityLogAlertAllOfCondition

An Activity Log alert condition that is met when all its member conditions are met.

Name Type Description
allOf

The list of activity log alert conditions.

ActivityLogAlertLeafCondition

An Activity Log alert condition that is met by comparing an activity log field and value.

Name Type Description
equals
  • string

The field value will be compared to this value (case-insensitive) to determine if the condition is met.

field
  • string

The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'.

ActivityLogAlertList

A list of activity log alerts.

Name Type Description
nextLink
  • string

Provides the link to retrieve the next set of elements.

value

The list of activity log alerts.

ActivityLogAlertResource

An activity log alert resource.

Name Type Description
id
  • string

Azure resource Id

location
  • string

Resource location

name
  • string

Azure resource name

properties.actions

The actions that will activate when the condition is met.

properties.condition

The condition that will cause this alert to activate.

properties.description
  • string

A description of this activity log alert.

properties.enabled
  • boolean

Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated.

properties.scopes
  • string[]

A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item.

tags
  • object

Resource tags

type
  • string

Azure resource type

ErrorResponse

Describes the format of Error response.

Name Type Description
code
  • string

Error code

message
  • string

Error message indicating why the operation failed.