Azure Networking Services Packet Captures API
The PacketCaptures API from Azure Networking Services — 4 operation(s) for packetcaptures.
The PacketCaptures API from Azure Networking Services — 4 operation(s) for packetcaptures.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/azure-networking-services:azure-networking-services-packetcaptures-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: WebApplicationFirewallManagement Packet Captures API
version: '2026-03-01'
description: APIs to manage Microsoft Azure network resources.
x-typespec-generated:
- emitter: '@azure-tools/typespec-autorest'
servers:
- url: https://management.azure.com
security:
- azure_auth:
- user_impersonation
tags:
- name: PacketCaptures
paths:
? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures
: get:
operationId: PacketCaptures_List
tags:
- PacketCaptures
description: Lists all packet capture sessions within the specified resource group.
parameters:
- $ref: '#/components/parameters/ApiVersionParameter'
- $ref: '#/components/parameters/SubscriptionIdParameter'
- $ref: '#/components/parameters/ResourceGroupNameParameter'
- name: networkWatcherName
in: path
description: The name of the network watcher.
required: true
schema:
type: string
responses:
'200':
description: Azure operation completed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/PacketCaptureListResult'
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ms-pageable:
nextLinkName: nextLink
summary: Packet captures list
x-summary-source: derived
? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}
: get:
operationId: PacketCaptures_Get
tags:
- PacketCaptures
description: Gets a packet capture session by name.
parameters:
- $ref: '#/components/parameters/ApiVersionParameter'
- $ref: '#/components/parameters/SubscriptionIdParameter'
- $ref: '#/components/parameters/ResourceGroupNameParameter'
- name: networkWatcherName
in: path
description: The name of the network watcher.
required: true
schema:
type: string
- name: packetCaptureName
in: path
description: The name of the packet capture session.
required: true
schema:
type: string
responses:
'200':
description: Azure operation completed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/PacketCaptureResult'
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
summary: Packet captures get
x-summary-source: derived
put:
operationId: PacketCaptures_Create
tags:
- PacketCaptures
description: Create and start a packet capture on the specified VM.
parameters:
- $ref: '#/components/parameters/ApiVersionParameter'
- $ref: '#/components/parameters/SubscriptionIdParameter'
- $ref: '#/components/parameters/ResourceGroupNameParameter'
- name: networkWatcherName
in: path
description: The name of the network watcher.
required: true
schema:
type: string
- name: packetCaptureName
in: path
description: The name of the packet capture session.
required: true
schema:
type: string
responses:
'201':
description: Resource 'PacketCaptureResult' create operation succeeded
headers:
Azure-AsyncOperation:
description: A link to the status monitor
schema:
type: string
Retry-After:
description: The Retry-After header can indicate how long the client should wait before polling the operation status.
schema:
type: integer
format: int32
content:
application/json:
schema:
$ref: '#/components/schemas/PacketCaptureResult'
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ms-long-running-operation-options:
final-state-via: azure-async-operation
final-state-schema: '#/definitions/PacketCaptureResult'
x-ms-long-running-operation: true
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PacketCapture'
description: Parameters that define the create packet capture operation.
required: true
summary: Packet captures create
x-summary-source: derived
delete:
operationId: PacketCaptures_Delete
tags:
- PacketCaptures
description: Deletes the specified packet capture session.
parameters:
- $ref: '#/components/parameters/ApiVersionParameter'
- $ref: '#/components/parameters/SubscriptionIdParameter'
- $ref: '#/components/parameters/ResourceGroupNameParameter'
- name: networkWatcherName
in: path
description: The name of the network watcher.
required: true
schema:
type: string
- name: packetCaptureName
in: path
description: The name of the packet capture session.
required: true
schema:
type: string
responses:
'202':
description: Resource operation accepted.
headers:
Location:
description: The Location header contains the URL where the status of the long running operation can be checked.
schema:
type: string
Retry-After:
description: The Retry-After header can indicate how long the client should wait before polling the operation status.
schema:
type: integer
format: int32
'204':
description: There is no content to send for this request, but the headers may be useful.
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ms-long-running-operation-options:
final-state-via: location
x-ms-long-running-operation: true
summary: Packet captures delete
x-summary-source: derived
? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus
: post:
operationId: PacketCaptures_GetStatus
tags:
- PacketCaptures
description: Query the status of a running packet capture session.
parameters:
- $ref: '#/components/parameters/ApiVersionParameter'
- $ref: '#/components/parameters/SubscriptionIdParameter'
- $ref: '#/components/parameters/ResourceGroupNameParameter'
- name: networkWatcherName
in: path
description: The name of the network watcher.
required: true
schema:
type: string
- name: packetCaptureName
in: path
description: The name of the packet capture session.
required: true
schema:
type: string
responses:
'200':
description: Azure operation completed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/PacketCaptureQueryStatusResult'
'202':
description: Azure operation completed successfully.
headers:
Location:
description: The Location header contains the URL where the status of the long running operation can be checked.
schema:
type: string
Retry-After:
description: The Retry-After header can indicate how long the client should wait before polling the operation status.
schema:
type: integer
format: int32
content:
application/json:
schema:
$ref: '#/components/schemas/PacketCaptureQueryStatusResult'
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ms-long-running-operation-options:
final-state-via: location
final-state-schema: '#/definitions/PacketCaptureQueryStatusResult'
x-ms-long-running-operation: true
summary: Packet captures get status
x-summary-source: derived
? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop
: post:
operationId: PacketCaptures_Stop
tags:
- PacketCaptures
description: Stops a specified packet capture session.
parameters:
- $ref: '#/components/parameters/ApiVersionParameter'
- $ref: '#/components/parameters/SubscriptionIdParameter'
- $ref: '#/components/parameters/ResourceGroupNameParameter'
- name: networkWatcherName
in: path
description: The name of the network watcher.
required: true
schema:
type: string
- name: packetCaptureName
in: path
description: The name of the packet capture session.
required: true
schema:
type: string
responses:
'200':
description: Azure operation completed successfully.
'202':
description: Resource operation accepted.
headers:
Location:
description: The Location header contains the URL where the status of the long running operation can be checked.
schema:
type: string
Retry-After:
description: The Retry-After header can indicate how long the client should wait before polling the operation status.
schema:
type: integer
format: int32
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ms-long-running-operation-options:
final-state-via: location
x-ms-long-running-operation: true
summary: Packet captures stop
x-summary-source: derived
components:
schemas:
PacketCaptureParameters:
type: object
description: Parameters that define the create packet capture operation.
properties:
target:
type: string
description: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported.
scope:
$ref: '#/components/schemas/PacketCaptureMachineScope'
description: A 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.
targetType:
$ref: '#/components/schemas/PacketCaptureTargetType'
description: Target type of the resource provided.
bytesToCapturePerPacket:
type: integer
format: int64
description: Number of bytes captured per packet, the remaining bytes are truncated.
default: 0
minimum: 0
maximum: 4294967295
totalBytesPerSession:
type: integer
format: int64
description: Maximum size of the capture output.
default: 1073741824
minimum: 0
maximum: 4294967295
timeLimitInSeconds:
type: integer
format: int32
description: Maximum duration of the capture session in seconds.
default: 18000
minimum: 0
maximum: 18000
storageLocation:
$ref: '#/components/schemas/PacketCaptureStorageLocation'
description: The storage location for a packet capture session.
filters:
type: array
description: A list of packet capture filters.
items:
$ref: '#/components/schemas/PacketCaptureFilter'
continuousCapture:
type: boolean
description: This 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'.
captureSettings:
$ref: '#/components/schemas/PacketCaptureSettings'
description: The capture setting holds the 'FileCount', 'FileSizeInBytes', 'SessionTimeLimitInSeconds' values.
required:
- target
- storageLocation
PacketCaptureListResult:
type: object
description: List of packet capture sessions.
properties:
value:
type: array
description: Information about packet capture sessions.
items:
$ref: '#/components/schemas/PacketCaptureResult'
nextLink:
type: string
description: URL to get the next set of results.
PcError:
type: string
enum:
- InternalError
- AgentStopped
- CaptureFailed
- LocalFileFailed
- StorageFailed
x-ms-enum:
name: PcError
modelAsString: true
values:
- name: InternalError
value: InternalError
description: InternalError
- name: AgentStopped
value: AgentStopped
description: AgentStopped
- name: CaptureFailed
value: CaptureFailed
description: CaptureFailed
- name: LocalFileFailed
value: LocalFileFailed
description: LocalFileFailed
- name: StorageFailed
value: StorageFailed
description: StorageFailed
PacketCaptureSettings:
type: object
description: The storage location for a packet capture session.
properties:
fileCount:
type: integer
format: int32
description: Number of file count. Default value of count is 10 and maximum number is 10000.
default: 10
minimum: 0
maximum: 10000
fileSizeInBytes:
type: integer
format: int64
description: Number of bytes captured per packet. Default value in bytes 104857600 (100MB) and maximum in bytes 4294967295 (4GB).
default: 104857600
minimum: 0
maximum: 4294967295
sessionTimeLimitInSeconds:
type: integer
format: int32
description: Maximum duration of the capture session in seconds is 604800s (7 days) for a file. Default value in second 86400s (1 day).
default: 86400
minimum: 0
maximum: 604800
PacketCaptureResultProperties:
type: object
description: The properties of a packet capture session.
properties:
provisioningState:
$ref: '#/components/schemas/ProvisioningState'
description: The provisioning state of the packet capture session.
readOnly: true
allOf:
- $ref: '#/components/schemas/PacketCaptureParameters'
PacketCaptureMachineScope:
type: object
description: A 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.
properties:
include:
type: array
description: List of AzureVMSS instances to run packet capture on.
items:
type: string
exclude:
type: array
description: List of AzureVMSS instances which has to be excluded from the AzureVMSS from running packet capture.
items:
type: string
PcStatus:
type: string
description: The status of the packet capture session.
enum:
- NotStarted
- Running
- Stopped
- Error
- Unknown
x-ms-enum:
name: PcStatus
modelAsString: true
values:
- name: NotStarted
value: NotStarted
description: NotStarted
- name: Running
value: Running
description: Running
- name: Stopped
value: Stopped
description: Stopped
- name: Error
value: Error
description: Error
- name: Unknown
value: Unknown
description: Unknown
ProvisioningState:
type: string
description: Provisioning states of a resource.
enum:
- Failed
- Succeeded
- Canceled
- Creating
- Updating
- Deleting
x-ms-enum:
name: ProvisioningState
modelAsString: true
values:
- name: Failed
value: Failed
description: Failed
- name: Succeeded
value: Succeeded
description: Succeeded
- name: Canceled
value: Canceled
description: Canceled
- name: Creating
value: Creating
description: Creating
- name: Updating
value: Updating
description: Updating
- name: Deleting
value: Deleting
description: Deleting
PacketCaptureQueryStatusResult:
type: object
description: Status of packet capture session.
properties:
name:
type: string
description: The name of the packet capture resource.
id:
type: string
description: The ID of the packet capture resource.
captureStartTime:
type: string
format: date-time
description: The start time of the packet capture session.
packetCaptureStatus:
$ref: '#/components/schemas/PcStatus'
description: The status of the packet capture session.
stopReason:
type: string
description: The reason the current packet capture session was stopped.
packetCaptureError:
type: array
description: List of errors of packet capture session.
items:
$ref: '#/components/schemas/PcError'
ErrorResponse:
type: object
description: The error object.
properties:
error:
$ref: '#/components/schemas/ErrorDetails'
title: Error
description: The error details object.
PacketCapture:
type: object
description: Parameters that define the create packet capture operation.
properties:
properties:
$ref: '#/components/schemas/PacketCaptureParameters'
description: Properties of the packet capture.
x-ms-client-flatten: true
required:
- properties
PacketCaptureFilter:
type: object
description: Filter that is applied to packet capture request. Multiple filters can be applied.
properties:
protocol:
type: string
description: Protocol to be filtered on.
default: Any
enum:
- TCP
- UDP
- Any
x-ms-enum:
name: PcProtocol
modelAsString: true
values:
- name: TCP
value: TCP
description: TCP
- name: UDP
value: UDP
description: UDP
- name: Any
value: Any
description: Any
localIPAddress:
type: string
description: '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.'
remoteIPAddress:
type: string
description: '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.'
localPort:
type: string
description: '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.'
remotePort:
type: string
description: '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.'
PacketCaptureTargetType:
type: string
description: Target type of the resource provided.
enum:
- AzureVM
- AzureVMSS
x-ms-enum:
name: PacketCaptureTargetType
modelAsString: false
values:
- name: AzureVM
value: AzureVM
description: AzureVM
- name: AzureVMSS
value: AzureVMSS
description: AzureVMSS
PacketCaptureStorageLocation:
type: object
description: The storage location for a packet capture session.
properties:
storageId:
type: string
description: The ID of the storage account to save the packet capture session. Required if no localPath or filePath is provided.
storagePath:
type: string
description: 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.
filePath:
type: string
description: This path is invalid if 'Continuous Capture' is provided with 'true' or 'false'. 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.
localPath:
type: string
description: This path is valid if 'Continuous Capture' is provided with 'true' or 'false' and required if no storage ID is provided, otherwise optional. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures.
PacketCaptureResult:
type: object
description: Information about packet capture session.
properties:
name:
type: string
description: Name of the packet capture session.
readOnly: true
id:
type: string
description: ID of the packet capture operation.
readOnly: true
etag:
type: string
description: A unique read-only string that changes whenever the resource is updated.
readOnly: true
properties:
$ref: '#/components/schemas/PacketCaptureResultProperties'
description: Properties of the packet capture result.
x-ms-client-flatten: true
ErrorDetails:
type: object
description: Common error details representation.
properties:
code:
type: string
description: Error code.
target:
type: string
description: Error target.
message:
type: string
description: Error message.
parameters:
SubscriptionIdParameter:
name: subscriptionId
in: path
description: The ID of the target subscription. The value must be an UUID.
required: true
schema:
type: string
format: uuid
ResourceGroupNameParameter:
name: resourceGroupName
in: path
description: The name of the resource group. The name is case insensitive.
required: true
x-ms-parameter-location: method
schema:
type: string
maxLength: 90
minLength: 1
ApiVersionParameter:
name: api-version
in: query
description: The API version to use for this operation.
required: true
schema:
type: string
minLength: 1
securitySchemes:
azure_auth:
type: oauth2
flows:
implicit:
scopes:
user_impersonation: impersonate your user account
authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
description: Azure Active Directory OAuth2 Flow.