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:

The request succeeded.

NameDatatypeDescription
idstringAzure resource Id
namestringAzure resource name
locationstringResource location
propertiesobjectThe Activity Log Alert rule properties of the resource.
tagsobjectResource tags
typestringAzure resource type

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, activityLogAlertNameGet an Activity Log Alert rule.
list_by_resource_groupselectsubscriptionId, resourceGroupNameGet a list of all Activity Log Alert rules in a resource group.
list_by_subscription_idselectsubscriptionIdGet a list of all Activity Log Alert rules in a subscription.
create_or_updateinsertsubscriptionId, resourceGroupName, activityLogAlertNameCreate a new Activity Log Alert rule or update an existing one.
updateupdatesubscriptionId, resourceGroupName, activityLogAlertNameUpdates '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.
deletedeletesubscriptionId, resourceGroupName, activityLogAlertNameDelete 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
activityLogAlertNamestringThe name of the Activity Log Alert rule.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.

SELECT examples

Get an Activity Log Alert rule.

SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.monitor.activity_log_alerts
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND activityLogAlertName = '{{ activityLogAlertName }}' -- required
;

INSERT examples

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

INSERT INTO azure.monitor.activity_log_alerts (
data__location,
data__tags,
data__properties,
subscriptionId,
resourceGroupName,
activityLogAlertName
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ activityLogAlertName }}'
RETURNING
id,
name,
location,
properties,
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
data__tags = '{{ tags }}',
data__properties = '{{ properties }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND activityLogAlertName = '{{ activityLogAlertName }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

DELETE examples

Delete an Activity Log Alert rule.

DELETE FROM azure.monitor.activity_log_alerts
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND activityLogAlertName = '{{ activityLogAlertName }}' --required
;