Skip to main content

watchers

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

Overview

Namewatchers
TypeResource
Idazure.db_watcher.watchers

Fields

The following fields are returned by SELECT queries:

Azure operation completed successfully.

NameDatatypeDescription
identityobjectThe managed service identities assigned to this resource.
locationstringThe geo-location where the resource lives
propertiesobjectThe resource-specific properties for this resource.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, watcherNameGet a Watcher
list_by_resource_groupselectsubscriptionId, resourceGroupNameList Watcher resources by resource group
list_by_subscriptionselectsubscriptionIdList Watcher resources by subscription ID
create_or_updateinsertsubscriptionId, resourceGroupName, watcherNameCreate a Watcher
updateupdatesubscriptionId, resourceGroupName, watcherNameUpdate a Watcher
deletedeletesubscriptionId, resourceGroupName, watcherNameDelete a Watcher
startexecsubscriptionId, resourceGroupName, watcherNameThe action to start monitoring all targets configured for a database watcher.
stopexecsubscriptionId, resourceGroupName, watcherNameThe action to stop monitoring all targets configured for a database watcher.

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
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
watcherNamestringThe database watcher name.

SELECT examples

Get a Watcher

SELECT
identity,
location,
properties,
tags
FROM azure.db_watcher.watchers
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND watcherName = '{{ watcherName }}' -- required
;

INSERT examples

Create a Watcher

INSERT INTO azure.db_watcher.watchers (
data__properties,
data__identity,
data__tags,
data__location,
subscriptionId,
resourceGroupName,
watcherName
)
SELECT
'{{ properties }}',
'{{ identity }}',
'{{ tags }}',
'{{ location }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ watcherName }}'
RETURNING
identity,
location,
properties,
tags
;

UPDATE examples

Update a Watcher

UPDATE azure.db_watcher.watchers
SET
data__identity = '{{ identity }}',
data__tags = '{{ tags }}',
data__properties = '{{ properties }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND watcherName = '{{ watcherName }}' --required
RETURNING
identity,
location,
properties,
tags;

DELETE examples

Delete a Watcher

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

Lifecycle Methods

The action to start monitoring all targets configured for a database watcher.

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