Alert Processing Rules - Get By Name

Get an alert processing rule by name.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}?api-version=2021-08-08

URI Parameters

Name In Required Type Description
alertProcessingRuleName
path True

string

The name of the alert processing rule that needs to be fetched.

resourceGroupName
path True

string

Resource group name where the resource is created.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

api-version

Client API version.

Responses

Name Type Description
200 OK

AlertProcessingRule

OK. Returns the specific alert processing rule.

Headers

x-ms-request-id: string

Other Status Codes

errorResponse

Error response describing why the operation failed.

Examples

GetAlertProcessingRuleById

Sample request

GET https://management.azure.com/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression?api-version=2021-08-08

Sample response

{
  "id": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression",
  "type": "Microsoft.AlertsManagement/actionRules",
  "name": "DailySuppression",
  "location": "Global",
  "systemData": {
    "createdBy": "abc@microsoft.com",
    "createdByType": "User",
    "createdAt": "2018-06-12T22:05:09Z",
    "lastModifiedBy": "xyz@microsoft.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2018-06-12T22:05:09Z"
  },
  "properties": {
    "scopes": [
      "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg"
    ],
    "conditions": [
      {
        "field": "Severity",
        "operator": "Equals",
        "values": [
          "Sev0",
          "Sev2"
        ]
      },
      {
        "field": "MonitorService",
        "operator": "Equals",
        "values": [
          "Platform",
          "Application Insights"
        ]
      },
      {
        "field": "MonitorCondition",
        "operator": "Equals",
        "values": [
          "Fired"
        ]
      },
      {
        "field": "TargetResourceType",
        "operator": "NotEquals",
        "values": [
          "Microsoft.Compute/VirtualMachines"
        ]
      }
    ],
    "schedule": {
      "effectiveFrom": "2018-01-10T22:05:09",
      "effectiveUntil": "2018-12-10T22:05:09",
      "timeZone": "Pacific Standard Time",
      "recurrences": [
        {
          "recurrenceType": "Daily",
          "startTime": "06:00:00",
          "endTime": "14:00:00"
        },
        {
          "recurrenceType": "Weekly",
          "startTime": "10:00:00",
          "endTime": "20:00:00",
          "daysOfWeek": [
            "Saturday",
            "Sunday"
          ]
        }
      ]
    },
    "actions": [
      {
        "actionType": "AddActionGroups",
        "actionGroupIds": [
          "actiongGroup1",
          "actiongGroup2"
        ]
      }
    ],
    "description": "Alert processing rule on resource group for daily and weekly scheduling",
    "enabled": true
  },
  "tags": {}
}

Definitions

Name Description
AddActionGroups

Add action groups to alert processing rule.

AlertProcessingRule

Alert processing rule object containing target scopes, conditions and scheduling logic.

AlertProcessingRuleProperties

Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule.

api-version

Client API version.

Condition

Condition to trigger an alert processing rule.

createdByType

The type of identity that created the resource.

DailyRecurrence

Daily recurrence object.

DaysOfWeek

Days of week.

errorResponse

An error response from the service.

errorResponseBody

Details of error response.

Field

Field for a given condition.

MonthlyRecurrence

Monthly recurrence object.

Operator

Operator for a given condition.

RemoveAllActionGroups

Indicates if all action groups should be removed.

Schedule

Scheduling configuration for a given alert processing rule.

systemData

Metadata pertaining to creation and last modification of the resource.

WeeklyRecurrence

Weekly recurrence object.

AddActionGroups

Add action groups to alert processing rule.

Name Type Description
actionGroupIds

string[]

List of action group Ids to add to alert processing rule.

actionType string:

AddActionGroups

Action that should be applied.

AlertProcessingRule

Alert processing rule object containing target scopes, conditions and scheduling logic.

Name Type Description
id

string

Azure resource Id

location

string

Resource location

name

string

Azure resource name

properties

AlertProcessingRuleProperties

Alert processing rule properties.

systemData

systemData

Alert processing rule system data.

tags

object

Resource tags

type

string

Azure resource type

AlertProcessingRuleProperties

Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule.

Name Type Default value Description
actions Action[]:

Actions to be applied.

conditions

Condition[]

Conditions on which alerts will be filtered.

description

string

Description of alert processing rule.

enabled

boolean

True

Indicates if the given alert processing rule is enabled or disabled.

schedule

Schedule

Scheduling for alert processing rule.

scopes

string[]

Scopes on which alert processing rule will apply.

api-version

Client API version.

Name Type Description
2021-08-08

string

Condition

Condition to trigger an alert processing rule.

Name Type Description
field

Field

Field for a given condition.

operator

Operator

Operator for a given condition.

values

string[]

List of values to match for a given condition.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

DailyRecurrence

Daily recurrence object.

Name Type Description
endTime

string

End time for recurrence.

recurrenceType string:

Daily

Specifies when the recurrence should be applied.

startTime

string

Start time for recurrence.

DaysOfWeek

Days of week.

Name Type Description
Friday

string

Monday

string

Saturday

string

Sunday

string

Thursday

string

Tuesday

string

Wednesday

string

errorResponse

An error response from the service.

Name Type Description
error

errorResponseBody

Details of error response.

errorResponseBody

Details of error response.

Name Type Description
code

string

Error code, intended to be consumed programmatically.

details

errorResponseBody[]

A list of additional details about the error.

message

string

Description of the error, intended for display in user interface.

target

string

Target of the particular error, for example name of the property.

Field

Field for a given condition.

Name Type Description
AlertContext

string

AlertRuleId

string

AlertRuleName

string

Description

string

MonitorCondition

string

MonitorService

string

Severity

string

SignalType

string

TargetResource

string

TargetResourceGroup

string

TargetResourceType

string

MonthlyRecurrence

Monthly recurrence object.

Name Type Description
daysOfMonth

integer[]

Specifies the values for monthly recurrence pattern.

endTime

string

End time for recurrence.

recurrenceType string:

Monthly

Specifies when the recurrence should be applied.

startTime

string

Start time for recurrence.

Operator

Operator for a given condition.

Name Type Description
Contains

string

DoesNotContain

string

Equals

string

NotEquals

string

RemoveAllActionGroups

Indicates if all action groups should be removed.

Name Type Description
actionType string:

RemoveAllActionGroups

Action that should be applied.

Schedule

Scheduling configuration for a given alert processing rule.

Name Type Description
effectiveFrom

string

Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix.

effectiveUntil

string

Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix.

recurrences Recurrence[]:

List of recurrences.

timeZone

string

Scheduling time zone.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

WeeklyRecurrence

Weekly recurrence object.

Name Type Description
daysOfWeek

DaysOfWeek[]

Specifies the values for weekly recurrence pattern.

endTime

string

End time for recurrence.

recurrenceType string:

Weekly

Specifies when the recurrence should be applied.

startTime

string

Start time for recurrence.