Share via


Network Watchers - Create Or Update

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

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}?api-version=2025-05-01

URI Parameters

Name In Required Type Description
networkWatcherName
path True

string

The name of the network watcher.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
id

string

Resource ID.

location

string

Resource location.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

NetworkWatcher

Resource 'NetworkWatcher' update operation succeeded

201 Created

NetworkWatcher

Resource 'NetworkWatcher' create operation succeeded

Other Status Codes

ErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create network watcher

Sample request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1?api-version=2025-05-01

{
  "location": "eastus",
  "properties": {}
}

Sample response

{
  "name": "nw1",
  "type": "Microsoft.Network/networkWatchers",
  "etag": "W/\"00000000-0000-0000-0000-000000000000\"",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1",
  "location": "eastus",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": {}
}
{
  "name": "nw1",
  "type": "Microsoft.Network/networkWatchers",
  "etag": "W/\"00000000-0000-0000-0000-000000000000\"",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1",
  "location": "eastus",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": {}
}

Definitions

Name Description
ErrorDetails

Common error details representation.

ErrorResponse

The error object.

NetworkWatcher

Network watcher in a resource group.

ProvisioningState

Provisioning states of a resource.

ErrorDetails

Common error details representation.

Name Type Description
code

string

Error code.

message

string

Error message.

target

string

Error target.

ErrorResponse

The error object.

Name Type Description
error

ErrorDetails

Error
The error details object.

NetworkWatcher

Network watcher in a resource group.

Name Type Description
etag

string

A unique read-only string that changes whenever the resource is updated.

id

string

Resource ID.

location

string

Resource location.

name

string

Resource name.

properties.provisioningState

ProvisioningState

The provisioning state of the network watcher resource.

tags

object

Resource tags.

type

string

Resource type.

ProvisioningState

Provisioning states of a resource.

Value Description
Failed

Failed

Succeeded

Succeeded

Canceled

Canceled

Creating

Creating

Updating

Updating

Deleting

Deleting