alerts
Creates, updates, deletes, gets or lists an alerts resource.
Overview
| Name | alerts |
| Type | Resource |
| Id | azure.authorization.alerts |
Fields
The following fields are returned by SELECT queries:
- get
- list_for_scope
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
alertConfiguration | object | The alert configuration. |
alertDefinition | object | The alert definition. |
alertIncidents | array | The alert incidents. |
incidentCount | integer | The number of generated incidents of the alert. |
isActive | boolean | False by default; true if the alert is active. |
lastModifiedDateTime | string (date-time) | The date time when the alert configuration was updated or new incidents were generated. |
lastScannedDateTime | string (date-time) | The date time when the alert was last scanned. |
scope | string | The alert scope. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
alertConfiguration | object | The alert configuration. |
alertDefinition | object | The alert definition. |
alertIncidents | array | The alert incidents. |
incidentCount | integer | The number of generated incidents of the alert. |
isActive | boolean | False by default; true if the alert is active. |
lastModifiedDateTime | string (date-time) | The date time when the alert configuration was updated or new incidents were generated. |
lastScannedDateTime | string (date-time) | The date time when the alert was last scanned. |
scope | string | The alert scope. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | scope, alert_id | Get the specified alert. | |
list_for_scope | select | scope | Gets alerts for a resource scope. | |
update | update | scope, alert_id | Update an alert. | |
refresh | exec | scope, alert_id | Refresh an alert. | |
refresh_all | exec | scope | Refresh 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.
| Name | Datatype | Description |
|---|---|---|
alert_id | string | The name of the alert to get. Required. |
scope | string | The fully qualified Azure Resource manager identifier of the resource. Required. |
SELECT examples
- get
- list_for_scope
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
;
Gets alerts for a resource scope.
SELECT
id,
name,
alertConfiguration,
alertDefinition,
alertIncidents,
incidentCount,
isActive,
lastModifiedDateTime,
lastScannedDateTime,
scope,
systemData,
type
FROM azure.authorization.alerts
WHERE scope = '{{ scope }}' -- required
;
UPDATE examples
- update
Update an alert.
UPDATE azure.authorization.alerts
SET
properties = '{{ properties }}'
WHERE
scope = '{{ scope }}' --required
AND alert_id = '{{ alert_id }}' --required;
Lifecycle Methods
- refresh
- refresh_all
Refresh an alert.
EXEC azure.authorization.alerts.refresh
@scope='{{ scope }}' --required,
@alert_id='{{ alert_id }}' --required
;
Refresh all alerts for a resource scope.
EXEC azure.authorization.alerts.refresh_all
@scope='{{ scope }}' --required
;