Skip to main content

activity_log_alerts

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

Overview

Nameactivity_log_alerts
TypeResource
Idazure.monitor.activity_log_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.
actionsobjectThe actions that will activate when the condition is met. Required.
conditionobjectThe condition that will cause this alert to activate. Required.
descriptionstringA description of this Activity Log Alert rule.
enabledbooleanIndicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.
locationstringThe location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions.
scopesarrayA list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectThe tags of the resource.
tenantScopestringThe tenant GUID. Must be provided for tenant-level and management group events rules.
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
getselectresource_group_name, activity_log_alert_name, subscription_idGet an Activity Log Alert rule.
list_by_resource_groupselectresource_group_name, subscription_idGet a list of all Activity Log Alert rules in a resource group.
list_by_subscription_idselectsubscription_idGet a list of all Activity Log Alert rules in a subscription.
create_or_updateinsertresource_group_name, activity_log_alert_name, subscription_idCreate a new Activity Log Alert rule or update an existing one.
updateupdateresource_group_name, activity_log_alert_name, subscription_idUpdates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation.
create_or_updatereplaceresource_group_name, activity_log_alert_name, subscription_idCreate a new Activity Log Alert rule or update an existing one.
deletedeleteresource_group_name, activity_log_alert_name, subscription_idDelete an Activity Log Alert rule.

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
activity_log_alert_namestringThe name of the Activity Log Alert rule. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Get an Activity Log Alert rule.

SELECT
id,
name,
actions,
condition,
description,
enabled,
location,
scopes,
systemData,
tags,
tenantScope,
type
FROM azure.monitor.activity_log_alerts
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND activity_log_alert_name = '{{ activity_log_alert_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a new Activity Log Alert rule or update an existing one.

INSERT INTO azure.monitor.activity_log_alerts (
properties,
tags,
location,
resource_group_name,
activity_log_alert_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ resource_group_name }}',
'{{ activity_log_alert_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation.

UPDATE azure.monitor.activity_log_alerts
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND activity_log_alert_name = '{{ activity_log_alert_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create a new Activity Log Alert rule or update an existing one.

REPLACE azure.monitor.activity_log_alerts
SET
properties = '{{ properties }}',
tags = '{{ tags }}',
location = '{{ location }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND activity_log_alert_name = '{{ activity_log_alert_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples

Delete an Activity Log Alert rule.

DELETE FROM azure.monitor.activity_log_alerts
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND activity_log_alert_name = '{{ activity_log_alert_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;