scheduled_query_rules
Creates, updates, deletes, gets or lists a scheduled_query_rules
resource.
Overview
Name | scheduled_query_rules |
Type | Resource |
Id | azure.monitor.scheduled_query_rules |
Fields
- vw_scheduled_query_rules
- scheduled_query_rules
Name | Datatype | Description |
---|---|---|
id | text | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name | text | The name of the resource |
description | text | field from the properties object |
actions | text | field from the properties object |
auto_mitigate | text | field from the properties object |
check_workspace_alerts_storage_configured | text | field from the properties object |
created_with_api_version | text | field from the properties object |
criteria | text | field from the properties object |
display_name | text | field from the properties object |
enabled | text | field from the properties object |
etag | text | The 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_frequency | text | field from the properties object |
identity | text | Identity for the resource. |
is_legacy_log_analytics_rule | text | field from the properties object |
is_workspace_alerts_storage_configured | text | field from the properties object |
kind | text | Indicates the type of scheduled query rule. The default is LogAlert. |
location | text | The geo-location where the resource lives |
mute_actions_duration | text | field from the properties object |
override_query_time_range | text | field from the properties object |
resourceGroupName | text | field from the properties object |
ruleName | text | field from the properties object |
rule_resolve_configuration | text | field from the properties object |
scopes | text | field from the properties object |
severity | text | field from the properties object |
skip_query_validation | text | field from the properties object |
subscriptionId | text | field from the properties object |
system_data | text | field from the properties object |
tags | text | Resource tags. |
target_resource_types | text | field from the properties object |
type | text | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
window_size | text | field from the properties object |
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 |
etag | string | The 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. |
identity | object | Identity for the resource. |
kind | string | Indicates the type of scheduled query rule. The default is LogAlert. |
location | string | The geo-location where the resource lives |
properties | object | scheduled query rule Definition |
systemData | object | Metadata pertaining to creation and last modification of the resource. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, ruleName, subscriptionId | Retrieve an scheduled query rule definition. |
list_by_resource_group | SELECT | resourceGroupName, subscriptionId | Retrieve scheduled query rule definitions in a resource group. |
list_by_subscription | SELECT | subscriptionId | Retrieve a scheduled query rule definitions in a subscription. |
create_or_update | INSERT | resourceGroupName, ruleName, subscriptionId, data__location, data__properties | Creates or updates a scheduled query rule. |
delete | DELETE | resourceGroupName, ruleName, subscriptionId | Deletes a scheduled query rule. |
update | UPDATE | resourceGroupName, ruleName, subscriptionId | Update a scheduled query rule. |
reconcile_nsp | EXEC | networkSecurityPerimeterConfigurationName, resourceGroupName, ruleName, subscriptionId | Reconcile network security perimeter configuration for ScheduledQueryRule resource. |
SELECT
examples
Retrieve a scheduled query rule definitions in a subscription.
- vw_scheduled_query_rules
- scheduled_query_rules
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 }}';
SELECT
id,
name,
etag,
identity,
kind,
location,
properties,
systemData,
tags,
type
FROM azure.monitor.scheduled_query_rules
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new scheduled_query_rules
resource.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: identity
value:
- name: principalId
value: string
- name: tenantId
value: string
- name: type
value: string
- name: tags
value: object
- name: location
value: string
- name: kind
value: string
- name: etag
value: string
- name: systemData
value:
- name: createdBy
value: string
- name: createdByType
value: string
- name: createdAt
value: string
- name: lastModifiedBy
value: string
- name: lastModifiedByType
value: string
- name: lastModifiedAt
value: string
- name: properties
value:
- name: createdWithApiVersion
value: string
- name: isLegacyLogAnalyticsRule
value: boolean
- name: description
value: string
- name: displayName
value: string
- name: severity
value: integer
- name: enabled
value: boolean
- name: scopes
value:
- string
- name: evaluationFrequency
value: string
- name: windowSize
value: string
- name: overrideQueryTimeRange
value: string
- name: targetResourceTypes
value:
- string
- name: criteria
value:
- name: allOf
value:
- - name: query
value: string
- name: timeAggregation
value: string
- name: metricMeasureColumn
value: string
- name: resourceIdColumn
value: string
- name: dimensions
value:
- - name: name
value: string
- name: operator
value: string
- name: values
value:
- string
- name: operator
value: string
- name: threshold
value: number
- name: failingPeriods
value:
- name: numberOfEvaluationPeriods
value: integer
- name: minFailingPeriodsToAlert
value: integer
- name: metricName
value: string
- name: muteActionsDuration
value: string
- name: actions
value:
- name: actionGroups
value:
- string
- name: customProperties
value: object
- name: actionProperties
value: object
- name: isWorkspaceAlertsStorageConfigured
value: boolean
- name: checkWorkspaceAlertsStorageConfigured
value: boolean
- name: skipQueryValidation
value: boolean
- name: autoMitigate
value: boolean
- name: ruleResolveConfiguration
value:
- name: autoResolved
value: boolean
- name: timeToResolve
value: string
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 }}';