Alerts - Get History

Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get history of this particular alert then use parent resource of scope. So in this example get history call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history'.

GET https://management.azure.com/{scope}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history?api-version=2019-03-01

URI Parameters

Name In Required Type Description
alertId
path True
  • string

Unique ID of an alert instance.

scope
path True
  • string

scope here is resourceId for which alert is created.

api-version
query True

API version.

Responses

Name Type Description
200 OK

OK. Returns the history of the specified alert.

Other Status Codes

Error response describing why the operation failed.

Examples

Resolve

Sample Request

GET https://management.azure.com/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100/history?api-version=2019-03-01

Sample Response

{
  "properties": {
    "alertId": "66114d64-d9d9-478b-95c9-b789d6502100",
    "modifications": [
      {
        "modificationEvent": "StateChange",
        "oldValue": "New",
        "newValue": "Acknowledged",
        "modifiedAt": "2018-06-13T06:14:15.7378737Z",
        "modifiedBy": "vikramm@microsoft.com",
        "comments": "Acknowledging alert",
        "description": "State changed from 'New' to 'Acknowledged'"
      },
      {
        "modificationEvent": "AlertCreated",
        "oldValue": "",
        "newValue": "",
        "modifiedAt": "2018-06-13T06:09:01Z",
        "modifiedBy": "System",
        "comments": "",
        "description": "New Alert Object is created"
      }
    ]
  },
  "id": "/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100/history/default",
  "type": "Microsoft.AlertsManagement/alerts",
  "name": "CPU Alert"
}

Definitions

alertModification

Alert Modification details

AlertModificationEvent

Reason for the modification

alertModificationItem

Alert modification item.

alertModificationProperties

Properties of the alert modification item.

AlertsManagementErrorResponse

An error response from the service.

api-version

API version.

errorResponseBody

Details of error response.

alertModification

Alert Modification details

Name Type Description
id
  • string

Azure resource Id

name
  • string

Azure resource name

properties

Properties of the alert modification item.

type
  • string

Azure resource type

AlertModificationEvent

Reason for the modification

Name Type Description
AlertCreated
  • string
MonitorConditionChange
  • string
StateChange
  • string

alertModificationItem

Alert modification item.

Name Type Description
comments
  • string

Modification comments

description
  • string

Description of the modification

modificationEvent

Reason for the modification

modifiedAt
  • string

Modified date and time

modifiedBy
  • string

Modified user details (Principal client name)

newValue
  • string

New value

oldValue
  • string

Old value

alertModificationProperties

Properties of the alert modification item.

Name Type Description
alertId
  • string

Unique Id of the alert for which the history is being retrieved

modifications

Modification details

AlertsManagementErrorResponse

An error response from the service.

Name Type Description
error

Details of error response.

api-version

API version.

Name Type Description
2018-05-05
  • string

errorResponseBody

Details of error response.

Name Type Description
code
  • string

Error code, intended to be consumed programmatically.

details

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.