Skip to main content

alerts

Creates, updates, deletes, gets or lists an alerts resource.

Overview

Namealerts
TypeResource
Idazure.authorization.alerts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
alertConfigurationobjectThe alert configuration.
alertDefinitionobjectThe alert definition.
alertIncidentsarrayThe alert incidents.
incidentCountintegerThe number of generated incidents of the alert.
isActivebooleanFalse by default; true if the alert is active.
lastModifiedDateTimestring (date-time)The date time when the alert configuration was updated or new incidents were generated.
lastScannedDateTimestring (date-time)The date time when the alert was last scanned.
scopestringThe alert scope.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, alert_idGet the specified alert.
list_for_scopeselectscopeGets alerts for a resource scope.
updateupdatescope, alert_idUpdate an alert.
refreshexecscope, alert_idRefresh an alert.
refresh_allexecscopeRefresh all alerts for a resource scope.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
alert_idstringThe name of the alert to get. Required.
scopestringThe fully qualified Azure Resource manager identifier of the resource. Required.

SELECT examples

Get the specified alert.

SELECT
id,
name,
alertConfiguration,
alertDefinition,
alertIncidents,
incidentCount,
isActive,
lastModifiedDateTime,
lastScannedDateTime,
scope,
systemData,
type
FROM azure.authorization.alerts
WHERE scope = '{{ scope }}' -- required
AND alert_id = '{{ alert_id }}' -- required
;

UPDATE examples

Update an alert.

UPDATE azure.authorization.alerts
SET
properties = '{{ properties }}'
WHERE
scope = '{{ scope }}' --required
AND alert_id = '{{ alert_id }}' --required;

Lifecycle Methods

Refresh an alert.

EXEC azure.authorization.alerts.refresh 
@scope='{{ scope }}' --required,
@alert_id='{{ alert_id }}' --required
;