Skip to main content

watchers

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

Overview

Namewatchers
TypeResource
Idazure.network.watchers

Fields

NameDatatypeDescription
idtextResource ID.
nametextResource name.
etagtextA unique read-only string that changes whenever the resource is updated.
locationtextResource location.
networkWatcherNametextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.
typetextResource type.

Methods

NameAccessible byRequired ParamsDescription
getSELECTnetworkWatcherName, resourceGroupName, 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_updateINSERTnetworkWatcherName, resourceGroupName, subscriptionIdCreates or updates a network watcher in the specified resource group.
deleteDELETEnetworkWatcherName, resourceGroupName, subscriptionIdDeletes the specified network watcher resource.
check_connectivityEXECnetworkWatcherName, resourceGroupName, subscriptionId, data__destination, data__sourceVerifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
set_flow_log_configurationEXECnetworkWatcherName, resourceGroupName, subscriptionId, data__properties, data__targetResourceIdConfigures flow log and traffic analytics (optional) on a specified resource.
update_tagsEXECnetworkWatcherName, resourceGroupName, subscriptionIdUpdates a network watcher tags.
verify_ip_flowEXECnetworkWatcherName, resourceGroupName, subscriptionId, data__direction, data__localIPAddress, data__localPort, data__protocol, data__remoteIPAddress, data__remotePort, data__targetResourceIdVerify IP flow from the specified VM to a location given the currently configured NSG rules.

SELECT examples

Gets all network watchers by subscription.

SELECT
id,
name,
etag,
location,
networkWatcherName,
provisioning_state,
resourceGroupName,
subscriptionId,
tags,
type
FROM azure.network.vw_watchers
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.network.watchers (
networkWatcherName,
resourceGroupName,
subscriptionId,
properties,
id,
location,
tags
)
SELECT
'{{ networkWatcherName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}',
'{{ id }}',
'{{ location }}',
'{{ tags }}'
;

DELETE example

Deletes the specified watchers resource.

/*+ delete */
DELETE FROM azure.network.watchers
WHERE networkWatcherName = '{{ networkWatcherName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';