Skip to main content

watchers

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

Overview

Namewatchers
TypeResource
Idazure.network.watchers

Fields

The following fields are returned by SELECT queries:

Request successful. The operation returns a network watcher resource.

NameDatatypeDescription
idstring (arm-id)Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
namestringThe name of the resource
etagstringA unique read-only string that changes whenever the resource is updated.
propertiesobjectProperties of the network watcher.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, networkWatcherName, subscriptionIdGets the specified network watcher by resource group.
listselectresourceGroupName, subscriptionIdGets all network watchers by resource group.
list_allselectsubscriptionIdGets all network watchers by subscription.
create_or_updateinsertresourceGroupName, networkWatcherName, subscriptionIdCreates or updates a network watcher in the specified resource group.
deletedeleteresourceGroupName, networkWatcherName, subscriptionIdDeletes the specified network watcher resource.
update_tagsexecresourceGroupName, networkWatcherName, subscriptionIdUpdates a network watcher tags.
verify_ip_flowexecresourceGroupName, networkWatcherName, subscriptionId, targetResourceId, direction, protocol, localPort, remotePort, localIPAddress, remoteIPAddressVerify IP flow from the specified VM to a location given the currently configured NSG rules.
set_flow_log_configurationexecresourceGroupName, networkWatcherName, subscriptionId, targetResourceId, propertiesConfigures flow log and traffic analytics (optional) on a specified resource.
check_connectivityexecresourceGroupName, networkWatcherName, subscriptionId, source, destinationVerifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.

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

SELECT examples

Gets the specified network watcher by resource group.

SELECT
id,
name,
etag,
properties,
systemData,
type
FROM azure.network.watchers
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND networkWatcherName = '{{ networkWatcherName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates or updates a network watcher in the specified resource group.

INSERT INTO azure.network.watchers (
data__properties,
resourceGroupName,
networkWatcherName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ networkWatcherName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;

DELETE examples

Deletes the specified network watcher resource.

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

Lifecycle Methods

Updates a network watcher tags.

EXEC azure.network.watchers.update_tags 
@resourceGroupName='{{ resourceGroupName }}' --required,
@networkWatcherName='{{ networkWatcherName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"tags": "{{ tags }}"
}'
;