activity_log_alerts
Creates, updates, deletes, gets or lists an activity_log_alerts resource.
Overview
| Name | activity_log_alerts |
| Type | Resource |
| Id | azure.monitor.activity_log_alerts |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list_by_subscription_id
| 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. |
actions | object | The actions that will activate when the condition is met. Required. |
condition | object | The condition that will cause this alert to activate. Required. |
description | string | A description of this Activity Log Alert rule. |
enabled | boolean | Indicates 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. |
location | string | The location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions. |
scopes | array | A 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | The tags of the resource. |
tenantScope | string | The tenant GUID. Must be provided for tenant-level and management group events rules. |
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. |
actions | object | The actions that will activate when the condition is met. Required. |
condition | object | The condition that will cause this alert to activate. Required. |
description | string | A description of this Activity Log Alert rule. |
enabled | boolean | Indicates 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. |
location | string | The location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions. |
scopes | array | A 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | The tags of the resource. |
tenantScope | string | The tenant GUID. Must be provided for tenant-level and management group events rules. |
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. |
actions | object | The actions that will activate when the condition is met. Required. |
condition | object | The condition that will cause this alert to activate. Required. |
description | string | A description of this Activity Log Alert rule. |
enabled | boolean | Indicates 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. |
location | string | The location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions. |
scopes | array | A 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | The tags of the resource. |
tenantScope | string | The tenant GUID. Must be provided for tenant-level and management group events rules. |
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 | resource_group_name, activity_log_alert_name, subscription_id | Get an Activity Log Alert rule. | |
list_by_resource_group | select | resource_group_name, subscription_id | Get a list of all Activity Log Alert rules in a resource group. | |
list_by_subscription_id | select | subscription_id | Get a list of all Activity Log Alert rules in a subscription. | |
create_or_update | insert | resource_group_name, activity_log_alert_name, subscription_id | Create a new Activity Log Alert rule or update an existing one. | |
update | update | resource_group_name, activity_log_alert_name, subscription_id | 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. | |
create_or_update | replace | resource_group_name, activity_log_alert_name, subscription_id | Create a new Activity Log Alert rule or update an existing one. | |
delete | delete | resource_group_name, activity_log_alert_name, subscription_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
activity_log_alert_name | string | The name of the Activity Log Alert rule. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_resource_group
- list_by_subscription_id
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
;
Get a list of all Activity Log Alert rules in a resource group.
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 subscription_id = '{{ subscription_id }}' -- required
;
Get a list of all Activity Log Alert rules in a subscription.
SELECT
id,
name,
actions,
condition,
description,
enabled,
location,
scopes,
systemData,
tags,
tenantScope,
type
FROM azure.monitor.activity_log_alerts
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: activity_log_alerts
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the activity_log_alerts resource.
- name: activity_log_alert_name
value: "{{ activity_log_alert_name }}"
description: Required parameter for the activity_log_alerts resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the activity_log_alerts resource.
- name: properties
description: |
The Activity Log Alert rule properties of the resource.
value:
tenantScope: "{{ tenantScope }}"
scopes:
- "{{ scopes }}"
condition:
allOf:
- field: "{{ field }}"
equals: "{{ equals }}"
containsAny: "{{ containsAny }}"
anyOf: "{{ anyOf }}"
actions:
actionGroups:
- actionGroupId: "{{ actionGroupId }}"
webhookProperties: "{{ webhookProperties }}"
actionProperties: "{{ actionProperties }}"
enabled: {{ enabled }}
description: "{{ description }}"
- name: tags
value: "{{ tags }}"
description: |
The tags of the resource.
- name: location
value: "{{ location }}"
description: |
The location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions.
UPDATE examples
- update
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_or_update
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
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
;