---
title: "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}"
method: GET
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}"
tags: ["MetricAlerts"]
---

# GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}

`GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}`

## Request

- Base URL: `https://management.azure.com`
- URL: `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}`
- Auth: OAuth 2
  - Implicit: `https://login.microsoftonline.com/common/oauth2/authorize`
  - Scopes: `user_impersonation`

Retrieve an alert rule definition.

## Path parameters

- `subscriptionId` string, required
- `resourceGroupName` string, required
- `ruleName` string, required

## Query parameters

- `api-version` string, required

## Response `200`

Successful request for a list of metric alerts

- MetricAlertResource: The metric alert resource.
  - `id` string: Azure resource Id
  - `name` string: Azure resource name
  - `type` string: Azure resource type
  - `location` string, required: Resource location
  - `tags` unknown
  - `properties` MetricAlertProperties, required: An alert rule.
    - `description` string: the description of the metric alert that will be included in the alert email.
    - `severity` integer, required: Alert severity {0, 1, 2, 3, 4}
    - `enabled` boolean, required: the flag that indicates whether the metric alert is enabled.
    - `scopes` string[], required: the list of resource id's that this metric alert is scoped to.
    - `evaluationFrequency` string, duration, required: how often the metric alert is evaluated represented in ISO 8601 duration format.
    - `windowSize` string, duration, required: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
    - `targetResourceType` string: the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
    - `targetResourceRegion` string: the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
    - `criteria` MetricAlertCriteria, required: The rule criteria that defines the conditions of the alert rule.
      - `odata.type` 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' | 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria', required: specifies the type of the alert criteria.
    - `autoMitigate` boolean: the flag that indicates whether the alert should be auto resolved or not. The default is true.
    - `actions` MetricAlertAction[]: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
      - `actionGroupId` string: the id of the action group to use.
      - `webHookProperties` object: This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
    - `lastUpdatedTime` string, date-time: Last time the rule was updated in ISO8601 format.
    - `isMigrated` boolean: the value indicating whether this alert rule is migrated.

## Other responses

- `default`: BadRequest

## Changes

- **2022-03-21** (2018-03-01) `6ca8f8b36bd8`: 3 breaking
  - added the new path request parameter `resourceGroupName`
  - added the new path request parameter `subscriptionId`
  - added the new required `query` request parameter `api-version`
- **2021-12-16** (2018-03-01) `f5b9cd3f2e33`: 1 warning
  - deleted the `path` request parameter `resourceGroupName`
- **2021-01-08** (2018-03-01) `bbac7bb48c26`: 2 warning
  - deleted the `path` request parameter `subscriptionId`
  - deleted the `query` request parameter `api-version`

[Operation history](https://skmtc.dev/azure/apis/monitormanagementclient-9/changes/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Insights/metricAlerts/:ruleName/get.md)

---

[API](https://skmtc.dev/azure/apis/monitormanagementclient-9.md) - [All operations](https://skmtc.dev/azure/apis/monitormanagementclient-9/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/monitormanagementclient-9/revisions/6ca8f8b36bd8?raw)
