Skip to main content

scheduled_query_rules

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

Overview

Namescheduled_query_rules
TypeResource
Idazure.monitor.scheduled_query_rules

Fields

NameDatatypeDescription
idtextFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
nametextThe name of the resource
descriptiontextfield from the properties object
actionstextfield from the properties object
auto_mitigatetextfield from the properties object
check_workspace_alerts_storage_configuredtextfield from the properties object
created_with_api_versiontextfield from the properties object
criteriatextfield from the properties object
display_nametextfield from the properties object
enabledtextfield from the properties object
etagtextThe etag field is not required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
evaluation_frequencytextfield from the properties object
identitytextIdentity for the resource.
is_legacy_log_analytics_ruletextfield from the properties object
is_workspace_alerts_storage_configuredtextfield from the properties object
kindtextIndicates the type of scheduled query rule. The default is LogAlert.
locationtextThe geo-location where the resource lives
mute_actions_durationtextfield from the properties object
override_query_time_rangetextfield from the properties object
resourceGroupNametextfield from the properties object
ruleNametextfield from the properties object
rule_resolve_configurationtextfield from the properties object
scopestextfield from the properties object
severitytextfield from the properties object
skip_query_validationtextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object
tagstextResource tags.
target_resource_typestextfield from the properties object
typetextThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
window_sizetextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, ruleName, subscriptionIdRetrieve an scheduled query rule definition.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdRetrieve scheduled query rule definitions in a resource group.
list_by_subscriptionSELECTsubscriptionIdRetrieve a scheduled query rule definitions in a subscription.
create_or_updateINSERTresourceGroupName, ruleName, subscriptionId, data__location, data__propertiesCreates or updates a scheduled query rule.
deleteDELETEresourceGroupName, ruleName, subscriptionIdDeletes a scheduled query rule.
updateUPDATEresourceGroupName, ruleName, subscriptionIdUpdate a scheduled query rule.
reconcile_nspEXECnetworkSecurityPerimeterConfigurationName, resourceGroupName, ruleName, subscriptionIdReconcile network security perimeter configuration for ScheduledQueryRule resource.

SELECT examples

Retrieve a scheduled query rule definitions in a subscription.

SELECT
id,
name,
description,
actions,
auto_mitigate,
check_workspace_alerts_storage_configured,
created_with_api_version,
criteria,
display_name,
enabled,
etag,
evaluation_frequency,
identity,
is_legacy_log_analytics_rule,
is_workspace_alerts_storage_configured,
kind,
location,
mute_actions_duration,
override_query_time_range,
resourceGroupName,
ruleName,
rule_resolve_configuration,
scopes,
severity,
skip_query_validation,
subscriptionId,
system_data,
tags,
target_resource_types,
type,
window_size
FROM azure.monitor.vw_scheduled_query_rules
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.monitor.scheduled_query_rules (
resourceGroupName,
ruleName,
subscriptionId,
data__location,
data__properties,
identity,
tags,
location,
kind,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ ruleName }}',
'{{ subscriptionId }}',
'{{ data__location }}',
'{{ data__properties }}',
'{{ identity }}',
'{{ tags }}',
'{{ location }}',
'{{ kind }}',
'{{ properties }}'
;

UPDATE example

Updates a scheduled_query_rules resource.

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

DELETE example

Deletes the specified scheduled_query_rules resource.

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