Microsoft.Network networkWatchers/packetCaptures 2020-04-01

The networkWatchers/packetCaptures resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

To create a Microsoft.Network/networkWatchers/packetCaptures resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.Network/networkWatchers/packetCaptures@2020-04-01' = {
  name: 'string'
  properties: {
    bytesToCapturePerPacket: int
    filters: [
      {
        localIPAddress: 'string'
        localPort: 'string'
        protocol: 'string'
        remoteIPAddress: 'string'
        remotePort: 'string'
      }
    ]
    storageLocation: {
      filePath: 'string'
      storageId: 'string'
      storagePath: 'string'
    }
    target: 'string'
    timeLimitInSeconds: int
    totalBytesPerSession: int
  }
}

Property values

networkWatchers/packetCaptures

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.Network/networkWatchers/packetCaptures'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2020-04-01'
name The resource name

See how to set names and types for child resources in Bicep or JSON ARM templates.
string (required)
properties The properties of a packet capture session. PacketCaptureParameters (required)

PacketCaptureParameters

Name Description Value
bytesToCapturePerPacket Number of bytes captured per packet, the remaining bytes are truncated. int
filters A list of packet capture filters. PacketCaptureFilter[]
storageLocation The storage location for a packet capture session. PacketCaptureStorageLocation (required)
target The ID of the targeted resource, only VM is currently supported. string (required)
timeLimitInSeconds Maximum duration of the capture session in seconds. int
totalBytesPerSession Maximum size of the capture output. int

PacketCaptureFilter

Name Description Value
localIPAddress Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. string
localPort Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. string
protocol Protocol to be filtered on. 'Any'
'TCP'
'UDP'
remoteIPAddress Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. string
remotePort Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. string

PacketCaptureStorageLocation

Name Description Value
filePath A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. string
storageId The ID of the storage account to save the packet capture session. Required if no local file path is provided. string
storagePath The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. string