Smart Detector Alert Rules - Patch

Patch a specific Smart Detector alert rule.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{alertRuleName}?api-version=2019-06-01

URI Parameters

Name In Required Type Description
alertRuleName
path True

string

The name of the alert rule.

resourceGroupName
path True

string

The name of the resource group.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

Client Api Version.

Request Body

Name Type Description
properties.actionGroups

ActionGroupsInformation

The alert rule actions.

properties.description

string

The alert rule description.

properties.frequency

string

The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes.

properties.severity

Severity

The alert rule severity.

properties.state

AlertRuleState

The alert rule state.

properties.throttling

ThrottlingInformation

The alert rule throttling information.

tags

object

The resource tags.

Responses

Name Type Description
200 OK

AlertRule

Successful request to patch Smart Detector alert rule.

Other Status Codes

SmartDetectorErrorResponse

Error response describing why the operation failed.

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

Patch alert rules

Sample request

PATCH https://management.azure.com/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule?api-version=2019-06-01

{
  "tags": {
    "newKey": "newVal"
  },
  "properties": {
    "description": "New description for patching",
    "frequency": "PT1M"
  }
}

Sample response

{
  "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule",
  "type": "Microsoft.AlertsManagement/smartDetectorAlertRules",
  "name": "MyAlertRule",
  "location": "global",
  "tags": {
    "newKey": "newVal"
  },
  "properties": {
    "description": "New description for patching",
    "state": "Enabled",
    "severity": "Sev3",
    "frequency": "PT1M",
    "detector": {
      "id": "VMMemoryLeak"
    },
    "scope": [
      "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyVms/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "actionGroups": [
      {
        "actionGroupId": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/actionGroups/providers/microsoft.insights/actiongroups/MyActionGroup"
      }
    ],
    "throttling": {
      "duration": "PT20M"
    }
  }
}

Definitions

Name Description
ActionGroupsInformation

The Action Groups information, used by the alert rule.

AlertRule

The alert rule information

AlertRulePatchObject

The alert rule patch information

AlertRuleState

The alert rule state.

Detector

The detector information. By default this is not populated, unless it's specified in expandDetector

Severity

The alert rule severity.

SmartDetectorErrorResponse

Describe the format of an Error response.

ThrottlingInformation

Optional throttling information for the alert rule.

ActionGroupsInformation

The Action Groups information, used by the alert rule.

Name Type Description
customEmailSubject

string

An optional custom email subject to use in email notifications.

customWebhookPayload

string

An optional custom web-hook payload to use in web-hook notifications.

groupIds

string[]

The Action Group resource IDs.

AlertRule

The alert rule information

Name Type Default value Description
id

string

The resource ID.

location

string

global

The resource location.

name

string

The resource name.

properties.actionGroups

ActionGroupsInformation

The alert rule actions.

properties.description

string

The alert rule description.

properties.detector

Detector

The alert rule's detector.

properties.frequency

string

The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes.

properties.scope

string[]

The alert rule resources scope.

properties.severity

Severity

The alert rule severity.

properties.state

AlertRuleState

The alert rule state.

properties.throttling

ThrottlingInformation

The alert rule throttling information.

tags

object

The resource tags.

type

string

The resource type.

AlertRulePatchObject

The alert rule patch information

Name Type Description
id

string

The resource ID.

name

string

The resource name.

properties.actionGroups

ActionGroupsInformation

The alert rule actions.

properties.description

string

The alert rule description.

properties.frequency

string

The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 5 minutes.

properties.severity

Severity

The alert rule severity.

properties.state

AlertRuleState

The alert rule state.

properties.throttling

ThrottlingInformation

The alert rule throttling information.

tags

object

The resource tags.

type

string

The resource type.

AlertRuleState

The alert rule state.

Name Type Description
Disabled

string

Enabled

string

Detector

The detector information. By default this is not populated, unless it's specified in expandDetector

Name Type Description
description

string

The Smart Detector description. By default this is not populated, unless it's specified in expandDetector

id

string

The detector id.

imagePaths

string[]

The Smart Detector image path. By default this is not populated, unless it's specified in expandDetector

name

string

The Smart Detector name. By default this is not populated, unless it's specified in expandDetector

parameters

object

The detector's parameters.'

supportedResourceTypes

string[]

The Smart Detector supported resource types. By default this is not populated, unless it's specified in expandDetector

Severity

The alert rule severity.

Name Type Description
Sev0

string

Sev1

string

Sev2

string

Sev3

string

Sev4

string

SmartDetectorErrorResponse

Describe the format of an Error response.

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

ThrottlingInformation

Optional throttling information for the alert rule.

Name Type Description
duration

string

The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes