network_watchers
Creates, updates, deletes, gets or lists a network_watchers resource.
Overview
| Name | network_watchers |
| Type | Resource |
| Id | azure.network.network_watchers |
Fields
The following fields are returned by SELECT queries:
- get_next_hop
- get_azure_reachability_report
- get_troubleshooting
- get_network_configuration_diagnostic
- check_connectivity
- get_vm_security_rules
- get
- list
- list_all
| Name | Datatype | Description |
|---|---|---|
nextHopIpAddress | string | Next hop IP Address. |
nextHopType | string | Next hop type. Known values are: "Internet", "VirtualAppliance", "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", "VirtualApplianceEcmp", and "None". (Internet, VirtualAppliance, VirtualNetworkGateway, VnetLocal, HyperNetGateway, VirtualApplianceEcmp, None) |
routeTableId | string | The resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. |
| Name | Datatype | Description |
|---|---|---|
aggregationLevel | string | The aggregation level of Azure reachability report. Can be Country, State or City. Required. |
providerLocation | object | Parameters that define a geographic location. Required. |
reachabilityReport | array | List of Azure reachability report items. Required. |
| Name | Datatype | Description |
|---|---|---|
code | string | The result code of the troubleshooting. |
endTime | string (date-time) | The end time of the troubleshooting. |
results | array | Information from troubleshooting. |
startTime | string (date-time) | The start time of the troubleshooting. |
| Name | Datatype | Description |
|---|---|---|
results | array | List of network configuration diagnostic results. |
| Name | Datatype | Description |
|---|---|---|
avgLatencyInMs | integer | Average latency in milliseconds. |
connectionStatus | string | The connection status. Known values are: "Unknown", "Connected", "Disconnected", and "Degraded". (Unknown, Connected, Disconnected, Degraded) |
hops | array | List of hops between the source and the destination. |
maxLatencyInMs | integer | Maximum latency in milliseconds. |
minLatencyInMs | integer | Minimum latency in milliseconds. |
probesFailed | integer | Number of failed probes. |
probesSent | integer | Total number of probes sent. |
| Name | Datatype | Description |
|---|---|---|
networkInterfaces | array | List of network interfaces on the specified VM. |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
location | string | Resource location. |
provisioningState | string | The provisioning state of the network watcher resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
tags | object | Resource tags. |
type | string | Resource type. |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
location | string | Resource location. |
provisioningState | string | The provisioning state of the network watcher resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
tags | object | Resource tags. |
type | string | Resource type. |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
location | string | Resource location. |
provisioningState | string | The provisioning state of the network watcher resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
tags | object | Resource tags. |
type | string | Resource type. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_next_hop | select | resource_group_name, network_watcher_name, subscription_id | Gets the next hop from the specified VM. | |
get_azure_reachability_report | select | resource_group_name, network_watcher_name, subscription_id | NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions. | |
get_troubleshooting | select | resource_group_name, network_watcher_name, subscription_id | Initiate troubleshooting on a specified resource. | |
get_network_configuration_diagnostic | select | resource_group_name, network_watcher_name, subscription_id | Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. | |
check_connectivity | select | resource_group_name, network_watcher_name, subscription_id | Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. | |
get_vm_security_rules | select | resource_group_name, network_watcher_name, subscription_id | Gets the configured and effective security group rules on the specified VM. | |
get | select | resource_group_name, network_watcher_name, subscription_id | Gets the specified network watcher by resource group. | |
list | select | resource_group_name, subscription_id | Gets all network watchers by resource group. | |
list_all | select | subscription_id | Gets all network watchers by subscription. | |
create_or_update | insert | resource_group_name, network_watcher_name, subscription_id | Creates or updates a network watcher in the specified resource group. | |
update_tags | update | resource_group_name, network_watcher_name, subscription_id | Updates a network watcher tags. | |
create_or_update | replace | resource_group_name, network_watcher_name, subscription_id | Creates or updates a network watcher in the specified resource group. | |
delete | delete | resource_group_name, network_watcher_name, subscription_id | Deletes the specified network watcher resource. | |
list_available_providers | exec | resource_group_name, network_watcher_name, subscription_id | NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region. | |
get_topology | exec | resource_group_name, network_watcher_name, subscription_id | Gets the current network topology by resource group. | |
get_troubleshooting_result | exec | resource_group_name, network_watcher_name, subscription_id, targetResourceId | Get the last completed troubleshooting result on a specified resource. | |
get_flow_log_status | exec | resource_group_name, network_watcher_name, subscription_id, targetResourceId | Queries status of flow log and traffic analytics (optional) on a specified resource. | |
verify_ip_flow | exec | resource_group_name, network_watcher_name, subscription_id, targetResourceId, direction, protocol, localPort, remotePort, localIPAddress, remoteIPAddress | Verify IP flow from the specified VM to a location given the currently configured NSG rules. | |
set_flow_log_configuration | exec | resource_group_name, network_watcher_name, subscription_id, targetResourceId, properties | Configures flow log and traffic analytics (optional) on a specified resource. |
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.
| Name | Datatype | Description |
|---|---|---|
network_watcher_name | string | The name of the network watcher. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get_next_hop
- get_azure_reachability_report
- get_troubleshooting
- get_network_configuration_diagnostic
- check_connectivity
- get_vm_security_rules
- get
- list
- list_all
Gets the next hop from the specified VM.
SELECT
nextHopIpAddress,
nextHopType,
routeTableId
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions.
SELECT
aggregationLevel,
providerLocation,
reachabilityReport
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Initiate troubleshooting on a specified resource.
SELECT
code,
endTime,
results,
startTime
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results.
SELECT
results
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
SELECT
avgLatencyInMs,
connectionStatus,
hops,
maxLatencyInMs,
minLatencyInMs,
probesFailed,
probesSent
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets the configured and effective security group rules on the specified VM.
SELECT
networkInterfaces
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets the specified network watcher by resource group.
SELECT
id,
name,
etag,
location,
provisioningState,
tags,
type
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all network watchers by resource group.
SELECT
id,
name,
etag,
location,
provisioningState,
tags,
type
FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all network watchers by subscription.
SELECT
id,
name,
etag,
location,
provisioningState,
tags,
type
FROM azure.network.network_watchers
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a network watcher in the specified resource group.
INSERT INTO azure.network.network_watchers (
id,
location,
tags,
properties,
resource_group_name,
network_watcher_name,
subscription_id
)
SELECT
'{{ id }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ network_watcher_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type
;
# Description fields are for documentation purposes
- name: network_watchers
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the network_watchers resource.
- name: network_watcher_name
value: "{{ network_watcher_name }}"
description: Required parameter for the network_watchers resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the network_watchers resource.
- name: id
value: "{{ id }}"
description: |
Resource ID.
- name: location
value: "{{ location }}"
description: |
Resource location.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: properties
description: |
Properties of the network watcher.
value:
provisioningState: "{{ provisioningState }}"
UPDATE examples
- update_tags
Updates a network watcher tags.
UPDATE azure.network.network_watchers
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;
REPLACE examples
- create_or_update
Creates or updates a network watcher in the specified resource group.
REPLACE azure.network.network_watchers
SET
id = '{{ id }}',
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;
DELETE examples
- delete
Deletes the specified network watcher resource.
DELETE FROM azure.network.network_watchers
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- list_available_providers
- get_topology
- get_troubleshooting_result
- get_flow_log_status
- verify_ip_flow
- set_flow_log_configuration
NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region.
EXEC azure.network.network_watchers.list_available_providers
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"azureLocations": "{{ azureLocations }}",
"country": "{{ country }}",
"state": "{{ state }}",
"city": "{{ city }}"
}'
;
Gets the current network topology by resource group.
EXEC azure.network.network_watchers.get_topology
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"targetResourceGroupName": "{{ targetResourceGroupName }}",
"targetVirtualNetwork": "{{ targetVirtualNetwork }}",
"targetSubnet": "{{ targetSubnet }}"
}'
;
Get the last completed troubleshooting result on a specified resource.
EXEC azure.network.network_watchers.get_troubleshooting_result
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"targetResourceId": "{{ targetResourceId }}"
}'
;
Queries status of flow log and traffic analytics (optional) on a specified resource.
EXEC azure.network.network_watchers.get_flow_log_status
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"targetResourceId": "{{ targetResourceId }}"
}'
;
Verify IP flow from the specified VM to a location given the currently configured NSG rules.
EXEC azure.network.network_watchers.verify_ip_flow
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"targetResourceId": "{{ targetResourceId }}",
"direction": "{{ direction }}",
"protocol": "{{ protocol }}",
"localPort": "{{ localPort }}",
"remotePort": "{{ remotePort }}",
"localIPAddress": "{{ localIPAddress }}",
"remoteIPAddress": "{{ remoteIPAddress }}",
"targetNicResourceId": "{{ targetNicResourceId }}"
}'
;
Configures flow log and traffic analytics (optional) on a specified resource.
EXEC azure.network.network_watchers.set_flow_log_configuration
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"targetResourceId": "{{ targetResourceId }}",
"properties": "{{ properties }}",
"flowAnalyticsConfiguration": "{{ flowAnalyticsConfiguration }}",
"identity": "{{ identity }}"
}'
;