Skip to main content

packet_captures

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

Overview

Namepacket_captures
TypeResource
Idazure.network.packet_captures

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the packet capture operation.
namestringName of the packet capture session.
bytesToCapturePerPacketintegerNumber of bytes captured per packet, the remaining bytes are truncated.
captureSettingsobjectThe capture setting holds the 'FileCount', 'FileSizeInBytes', 'SessionTimeLimitInSeconds' values.
continuousCapturebooleanThis continuous capture is a nullable boolean, which can hold 'null', 'true' or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'.
etagstringA unique read-only string that changes whenever the resource is updated.
filtersarrayA list of packet capture filters.
provisioningStatestringThe provisioning state of the packet capture session. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
scopeobjectA list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS.
storageLocationobjectThe storage location for a packet capture session. Required.
targetstringThe ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. Required.
targetTypestringTarget type of the resource provided. Known values are: "AzureVM" and "AzureVMSS". (AzureVM, AzureVMSS)
timeLimitInSecondsintegerMaximum duration of the capture session in seconds.
totalBytesPerSessionintegerMaximum size of the capture output.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, network_watcher_name, packet_capture_name, subscription_idGets a packet capture session by name.
listselectresource_group_name, network_watcher_name, subscription_idLists all packet capture sessions within the specified resource group.
createinsertresource_group_name, network_watcher_name, packet_capture_name, subscription_id, propertiesCreate and start a packet capture on the specified VM.
deletedeleteresource_group_name, network_watcher_name, packet_capture_name, subscription_idDeletes the specified packet capture session.
get_statusexecresource_group_name, network_watcher_name, packet_capture_name, subscription_idQuery the status of a running packet capture session.
stopexecresource_group_name, network_watcher_name, packet_capture_name, subscription_idStops a specified packet capture session.

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.

NameDatatypeDescription
network_watcher_namestringThe name of the network watcher. Required.
packet_capture_namestringThe name of the packet capture session. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Gets a packet capture session by name.

SELECT
id,
name,
bytesToCapturePerPacket,
captureSettings,
continuousCapture,
etag,
filters,
provisioningState,
scope,
storageLocation,
target,
targetType,
timeLimitInSeconds,
totalBytesPerSession
FROM azure.network.packet_captures
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND packet_capture_name = '{{ packet_capture_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create and start a packet capture on the specified VM.

INSERT INTO azure.network.packet_captures (
properties,
resource_group_name,
network_watcher_name,
packet_capture_name,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ network_watcher_name }}',
'{{ packet_capture_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties
;

DELETE examples

Deletes the specified packet capture session.

DELETE FROM azure.network.packet_captures
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND packet_capture_name = '{{ packet_capture_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Query the status of a running packet capture session.

EXEC azure.network.packet_captures.get_status 
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@packet_capture_name='{{ packet_capture_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;