Skip to main content

activity_log_alerts

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

Overview

Nameactivity_log_alerts
TypeResource
Idazure.monitor.activity_log_alerts

Fields

NameDatatypeDescription
idtextThe resource Id.
nametextThe name of the resource.
descriptiontextfield from the properties object
actionstextfield from the properties object
activityLogAlertNametextfield from the properties object
conditiontextfield from the properties object
enabledtextfield from the properties object
locationtextThe location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions.
resourceGroupNametextfield from the properties object
scopestextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextThe tags of the resource.
typetextThe type of the resource.

Methods

NameAccessible byRequired ParamsDescription
getSELECTactivityLogAlertName, resourceGroupName, subscriptionIdGet an Activity Log Alert rule.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdGet 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_updateINSERTactivityLogAlertName, resourceGroupName, subscriptionIdCreate a new Activity Log Alert rule or update an existing one.
deleteDELETEactivityLogAlertName, resourceGroupName, subscriptionIdDelete an Activity Log Alert rule.
updateUPDATEactivityLogAlertName, resourceGroupName, subscriptionIdUpdates '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.

SELECT examples

Get a list of all Activity Log Alert rules in a subscription.

SELECT
id,
name,
description,
actions,
activityLogAlertName,
condition,
enabled,
location,
resourceGroupName,
scopes,
subscriptionId,
tags,
type
FROM azure.monitor.vw_activity_log_alerts
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new activity_log_alerts resource.

/*+ create */
INSERT INTO azure.monitor.activity_log_alerts (
activityLogAlertName,
resourceGroupName,
subscriptionId,
location,
tags,
properties
)
SELECT
'{{ activityLogAlertName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a activity_log_alerts resource.

/*+ update */
UPDATE azure.monitor.activity_log_alerts
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
activityLogAlertName = '{{ activityLogAlertName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified activity_log_alerts resource.

/*+ delete */
DELETE FROM azure.monitor.activity_log_alerts
WHERE activityLogAlertName = '{{ activityLogAlertName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';