Skip to main content

watchers

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

Overview

Namewatchers
TypeResource
Idazure.automation.watchers

Fields

NameDatatypeDescription
idtextFully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
nametextThe name of the resource
descriptiontextfield from the properties object
automationAccountNametextfield from the properties object
creation_timetextfield from the properties object
etagtextGets or sets the etag of the resource.
execution_frequency_in_secondstextfield from the properties object
last_modified_bytextfield from the properties object
last_modified_timetextfield from the properties object
locationtextThe geo-location where the resource lives
resourceGroupNametextfield from the properties object
script_nametextfield from the properties object
script_parameterstextfield from the properties object
script_run_ontextfield from the properties object
statustextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object
tagstextResource tags.
typetextThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
watcherNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTautomationAccountName, resourceGroupName, subscriptionId, watcherNameRetrieve the watcher identified by watcher name.
list_by_automation_accountSELECTautomationAccountName, resourceGroupName, subscriptionIdRetrieve a list of watchers.
create_or_updateINSERTautomationAccountName, resourceGroupName, subscriptionId, watcherNameCreate the watcher identified by watcher name.
deleteDELETEautomationAccountName, resourceGroupName, subscriptionId, watcherNameDelete the watcher by name.
updateUPDATEautomationAccountName, resourceGroupName, subscriptionId, watcherNameUpdate the watcher identified by watcher name.
startEXECautomationAccountName, resourceGroupName, subscriptionId, watcherNameResume the watcher identified by watcher name.
stopEXECautomationAccountName, resourceGroupName, subscriptionId, watcherNameResume the watcher identified by watcher name.

SELECT examples

Retrieve a list of watchers.

SELECT
id,
name,
description,
automationAccountName,
creation_time,
etag,
execution_frequency_in_seconds,
last_modified_by,
last_modified_time,
location,
resourceGroupName,
script_name,
script_parameters,
script_run_on,
status,
subscriptionId,
system_data,
tags,
type,
watcherName
FROM azure.automation.vw_watchers
WHERE automationAccountName = '{{ automationAccountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.automation.watchers (
automationAccountName,
resourceGroupName,
subscriptionId,
watcherName,
properties,
etag,
tags,
location
)
SELECT
'{{ automationAccountName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ watcherName }}',
'{{ properties }}',
'{{ etag }}',
'{{ tags }}',
'{{ location }}'
;

UPDATE example

Updates a watchers resource.

/*+ update */
UPDATE azure.automation.watchers
SET
properties = '{{ properties }}',
name = '{{ name }}'
WHERE
automationAccountName = '{{ automationAccountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';

DELETE example

Deletes the specified watchers resource.

/*+ delete */
DELETE FROM azure.automation.watchers
WHERE automationAccountName = '{{ automationAccountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';