Request Boddy Json Syntax: Network Watcher Rest API

Category: azure scripting and command line tools


Supong kichu on Mon, 09 Jul 2018 17:44:57

How can I create the JSON payload(Request body) to check the connectivity using network watcher Rest API. 

What is the expected payload? Could someone please give me a example? 


CHEEKATLAPRADEEP-MSFT on Tue, 10 Jul 2018 08:42:22

This example checks connectivity to a destination virtual machine over port 80.

$subscriptionId =

$resourceGroupName =

$networkWatcherName =

$sourceResourceId =

$destinationAddress =

$destinationPort =

$requestBody = @"


  'source': {

    'resourceId': '${sourceResourceId}',

    'port': 0


  'destination': {

    'resourceId': '${destinationAddress}',

    'port': ${destinationPort}




$response = armclient post

For more details, refer check connectivity using REST API.


If this answer was helpful, click “Mark as Answer” or “Up-Vote”. To provide additional feedback on your forum experience, click here

CHEEKATLAPRADEEP-MSFT on Thu, 12 Jul 2018 07:21:29

Just Checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same. And, if you have any further query do let us know.