Smart Detector Alert Rules - List By Resource Group

List all the existing Smart Detector alert rules within the subscription and resource group.

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

URI Parameters

Name In Required Type Description
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.

expandDetector
query

boolean

Indicates if Smart Detector should be expanded.

Responses

Name Type Description
200 OK

AlertRulesList

Successful request to list Smart Detector alert rules.

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

List alert rules

Sample Request

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

Sample Response

{
  "nextLink": null,
  "value": [
    {
      "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule",
      "type": "Microsoft.AlertsManagement/smartDetectorAlertRules",
      "name": "MyAlertRule",
      "location": "global",
      "tags": {},
      "properties": {
        "description": "Sample smart detector alert rule description",
        "state": "Enabled",
        "severity": "Sev3",
        "frequency": "PT5M",
        "detector": {
          "id": "VMMemoryLeak"
        },
        "scope": [
          "/subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"
        ],
        "actionGroups": [
          {
            "actionGroupId": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/MyActionGroups/providers/microsoft.insights/actionGroups/MyActionGroup"
          }
        ],
        "throttling": {
          "duration": "PT20M"
        }
      }
    },
    {
      "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MySecondAlertRule",
      "type": "Microsoft.AlertsManagement/smartDetectorAlertRules",
      "name": "MySecondAlertRule",
      "location": "global",
      "tags": {},
      "properties": {
        "description": "Sample smart detector alert rule description",
        "state": "Disabled",
        "severity": "Sev2",
        "frequency": "PT15M",
        "detector": {
          "id": "VMMemoryLeak"
        },
        "scope": [
          "/subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default"
        ],
        "actionGroups": [
          {
            "actionGroupId": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/MyActionGroups/providers/microsoft.insights/actionGroups/MyActionGroup"
          }
        ]
      }
    }
  ]
}

Definitions

Name Description
ActionGroupsInformation

The Action Groups information, used by the alert rule.

AlertRule

The alert rule information

AlertRulesList

List of Smart Detector alert rules.

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.

AlertRulesList

List of Smart Detector alert rules.

Name Type Description
nextLink

string

The URL to get the next set of results.

value

AlertRule[]

List of Smart Detector alert rules.

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