Skip to main content

watchers

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

Overview

Namewatchers
TypeResource
Idazure.automation.watchers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource Id for the resource
namestringThe name of the resource
etagstringGets or sets the etag of the resource.
locationstringThe geo-location where the resource lives
propertiesobjectGets or sets the watcher properties.
tagsobjectResource tags.
typestringThe type of the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, automationAccountName, watcherName, subscriptionIdRetrieve the watcher identified by watcher name.
list_by_automation_accountselectresourceGroupName, automationAccountName, subscriptionId$filterRetrieve a list of watchers.
create_or_updateinsertresourceGroupName, automationAccountName, watcherName, subscriptionIdCreate the watcher identified by watcher name.
updateupdateresourceGroupName, automationAccountName, watcherName, subscriptionIdUpdate the watcher identified by watcher name.
deletedeleteresourceGroupName, automationAccountName, watcherName, subscriptionIdDelete the watcher by name.
startexecresourceGroupName, automationAccountName, watcherName, subscriptionIdResume the watcher identified by watcher name.
stopexecresourceGroupName, automationAccountName, watcherName, subscriptionIdResume the watcher identified by watcher name.

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.

NameDatatypeDescription
automationAccountNamestringThe name of the automation account.
resourceGroupNamestringName of an Azure Resource group.
subscriptionIdstringGets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
watcherNamestringThe watcher name.
$filterstringThe filter to apply on the operation.

SELECT examples

Retrieve the watcher identified by watcher name.

SELECT
id,
name,
etag,
location,
properties,
tags,
type
FROM azure.automation.watchers
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND automationAccountName = '{{ automationAccountName }}' -- required
AND watcherName = '{{ watcherName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Create the watcher identified by watcher name.

INSERT INTO azure.automation.watchers (
data__properties,
data__etag,
data__tags,
data__location,
resourceGroupName,
automationAccountName,
watcherName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ etag }}',
'{{ tags }}',
'{{ location }}',
'{{ resourceGroupName }}',
'{{ automationAccountName }}',
'{{ watcherName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type
;

UPDATE examples

Update the watcher identified by watcher name.

UPDATE azure.automation.watchers
SET
data__properties = '{{ properties }}',
data__name = '{{ name }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND automationAccountName = '{{ automationAccountName }}' --required
AND watcherName = '{{ watcherName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;

DELETE examples

Delete the watcher by name.

DELETE FROM azure.automation.watchers
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND automationAccountName = '{{ automationAccountName }}' --required
AND watcherName = '{{ watcherName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;

Lifecycle Methods

Resume the watcher identified by watcher name.

EXEC azure.automation.watchers.start 
@resourceGroupName='{{ resourceGroupName }}' --required,
@automationAccountName='{{ automationAccountName }}' --required,
@watcherName='{{ watcherName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;