1. Packages
  2. Azure Classic
  3. API Docs
  4. network
  5. PacketCapture

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Configures Packet Capturing against a Virtual Machine using a Network Watcher.

    NOTE: This resource has been deprecated in favour of the azure.network.NetworkConnectionMonitor resource and will be removed in the next major version of the AzureRM Provider. The new resource shares the same fields as this one, and information on migrating across can be found in this guide.

    Example Usage

    Example coming soon!

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const exampleNetworkWatcher = new azure.network.NetworkWatcher("exampleNetworkWatcher", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
    });
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
        addressSpaces: ["10.0.0.0/16"],
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
    });
    const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
        resourceGroupName: exampleResourceGroup.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.2.0/24"],
    });
    const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        ipConfigurations: [{
            name: "testconfiguration1",
            subnetId: exampleSubnet.id,
            privateIpAddressAllocation: "Dynamic",
        }],
    });
    const exampleVirtualMachine = new azure.compute.VirtualMachine("exampleVirtualMachine", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        networkInterfaceIds: [exampleNetworkInterface.id],
        vmSize: "Standard_F2",
        storageImageReference: {
            publisher: "Canonical",
            offer: "UbuntuServer",
            sku: "16.04-LTS",
            version: "latest",
        },
        storageOsDisk: {
            name: "osdisk",
            caching: "ReadWrite",
            createOption: "FromImage",
            managedDiskType: "Standard_LRS",
        },
        osProfile: {
            computerName: "pctest-vm",
            adminUsername: "testadmin",
            adminPassword: "Password1234!",
        },
        osProfileLinuxConfig: {
            disablePasswordAuthentication: false,
        },
    });
    const exampleExtension = new azure.compute.Extension("exampleExtension", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        virtualMachineName: exampleVirtualMachine.name,
        publisher: "Microsoft.Azure.NetworkWatcher",
        type: "NetworkWatcherAgentLinux",
        typeHandlerVersion: "1.4",
        autoUpgradeMinorVersion: true,
    });
    const exampleAccount = new azure.storage.Account("exampleAccount", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        accountTier: "Standard",
        accountReplicationType: "LRS",
    });
    const examplePacketCapture = new azure.network.PacketCapture("examplePacketCapture", {
        networkWatcherName: exampleNetworkWatcher.name,
        resourceGroupName: exampleResourceGroup.name,
        targetResourceId: exampleVirtualMachine.id,
        storageLocation: {
            storageAccountId: exampleAccount.id,
        },
    }, {
        dependsOn: [exampleExtension],
    });
    

    Example coming soon!

    Example coming soon!

    Create PacketCapture Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PacketCapture(name: string, args: PacketCaptureArgs, opts?: CustomResourceOptions);
    @overload
    def PacketCapture(resource_name: str,
                      args: PacketCaptureArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def PacketCapture(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      network_watcher_name: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      storage_location: Optional[PacketCaptureStorageLocationArgs] = None,
                      target_resource_id: Optional[str] = None,
                      filters: Optional[Sequence[PacketCaptureFilterArgs]] = None,
                      maximum_bytes_per_packet: Optional[int] = None,
                      maximum_bytes_per_session: Optional[int] = None,
                      maximum_capture_duration: Optional[int] = None,
                      name: Optional[str] = None)
    func NewPacketCapture(ctx *Context, name string, args PacketCaptureArgs, opts ...ResourceOption) (*PacketCapture, error)
    public PacketCapture(string name, PacketCaptureArgs args, CustomResourceOptions? opts = null)
    public PacketCapture(String name, PacketCaptureArgs args)
    public PacketCapture(String name, PacketCaptureArgs args, CustomResourceOptions options)
    
    type: azure:network:PacketCapture
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PacketCaptureArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PacketCaptureArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PacketCaptureArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PacketCaptureArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PacketCaptureArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var packetCaptureResource = new Azure.Network.PacketCapture("packetCaptureResource", new()
    {
        NetworkWatcherName = "string",
        ResourceGroupName = "string",
        StorageLocation = new Azure.Network.Inputs.PacketCaptureStorageLocationArgs
        {
            FilePath = "string",
            StorageAccountId = "string",
            StoragePath = "string",
        },
        TargetResourceId = "string",
        Filters = new[]
        {
            new Azure.Network.Inputs.PacketCaptureFilterArgs
            {
                Protocol = "string",
                LocalIpAddress = "string",
                LocalPort = "string",
                RemoteIpAddress = "string",
                RemotePort = "string",
            },
        },
        MaximumBytesPerPacket = 0,
        MaximumBytesPerSession = 0,
        MaximumCaptureDuration = 0,
        Name = "string",
    });
    
    example, err := network.NewPacketCapture(ctx, "packetCaptureResource", &network.PacketCaptureArgs{
    	NetworkWatcherName: pulumi.String("string"),
    	ResourceGroupName:  pulumi.String("string"),
    	StorageLocation: &network.PacketCaptureStorageLocationArgs{
    		FilePath:         pulumi.String("string"),
    		StorageAccountId: pulumi.String("string"),
    		StoragePath:      pulumi.String("string"),
    	},
    	TargetResourceId: pulumi.String("string"),
    	Filters: network.PacketCaptureFilterArray{
    		&network.PacketCaptureFilterArgs{
    			Protocol:        pulumi.String("string"),
    			LocalIpAddress:  pulumi.String("string"),
    			LocalPort:       pulumi.String("string"),
    			RemoteIpAddress: pulumi.String("string"),
    			RemotePort:      pulumi.String("string"),
    		},
    	},
    	MaximumBytesPerPacket:  pulumi.Int(0),
    	MaximumBytesPerSession: pulumi.Int(0),
    	MaximumCaptureDuration: pulumi.Int(0),
    	Name:                   pulumi.String("string"),
    })
    
    var packetCaptureResource = new PacketCapture("packetCaptureResource", PacketCaptureArgs.builder()
        .networkWatcherName("string")
        .resourceGroupName("string")
        .storageLocation(PacketCaptureStorageLocationArgs.builder()
            .filePath("string")
            .storageAccountId("string")
            .storagePath("string")
            .build())
        .targetResourceId("string")
        .filters(PacketCaptureFilterArgs.builder()
            .protocol("string")
            .localIpAddress("string")
            .localPort("string")
            .remoteIpAddress("string")
            .remotePort("string")
            .build())
        .maximumBytesPerPacket(0)
        .maximumBytesPerSession(0)
        .maximumCaptureDuration(0)
        .name("string")
        .build());
    
    packet_capture_resource = azure.network.PacketCapture("packetCaptureResource",
        network_watcher_name="string",
        resource_group_name="string",
        storage_location={
            "file_path": "string",
            "storage_account_id": "string",
            "storage_path": "string",
        },
        target_resource_id="string",
        filters=[{
            "protocol": "string",
            "local_ip_address": "string",
            "local_port": "string",
            "remote_ip_address": "string",
            "remote_port": "string",
        }],
        maximum_bytes_per_packet=0,
        maximum_bytes_per_session=0,
        maximum_capture_duration=0,
        name="string")
    
    const packetCaptureResource = new azure.network.PacketCapture("packetCaptureResource", {
        networkWatcherName: "string",
        resourceGroupName: "string",
        storageLocation: {
            filePath: "string",
            storageAccountId: "string",
            storagePath: "string",
        },
        targetResourceId: "string",
        filters: [{
            protocol: "string",
            localIpAddress: "string",
            localPort: "string",
            remoteIpAddress: "string",
            remotePort: "string",
        }],
        maximumBytesPerPacket: 0,
        maximumBytesPerSession: 0,
        maximumCaptureDuration: 0,
        name: "string",
    });
    
    type: azure:network:PacketCapture
    properties:
        filters:
            - localIpAddress: string
              localPort: string
              protocol: string
              remoteIpAddress: string
              remotePort: string
        maximumBytesPerPacket: 0
        maximumBytesPerSession: 0
        maximumCaptureDuration: 0
        name: string
        networkWatcherName: string
        resourceGroupName: string
        storageLocation:
            filePath: string
            storageAccountId: string
            storagePath: string
        targetResourceId: string
    

    PacketCapture Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PacketCapture resource accepts the following input properties:

    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    StorageLocation PacketCaptureStorageLocation
    A storage_location block as defined below. Changing this forces a new resource to be created.
    TargetResourceId string
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    Filters List<PacketCaptureFilter>
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    MaximumBytesPerPacket int
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    MaximumBytesPerSession int
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    MaximumCaptureDuration int
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    Name string
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    StorageLocation PacketCaptureStorageLocationArgs
    A storage_location block as defined below. Changing this forces a new resource to be created.
    TargetResourceId string
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    Filters []PacketCaptureFilterArgs
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    MaximumBytesPerPacket int
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    MaximumBytesPerSession int
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    MaximumCaptureDuration int
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    Name string
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storageLocation PacketCaptureStorageLocation
    A storage_location block as defined below. Changing this forces a new resource to be created.
    targetResourceId String
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters List<PacketCaptureFilter>
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximumBytesPerPacket Integer
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximumBytesPerSession Integer
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximumCaptureDuration Integer
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name String
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    networkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storageLocation PacketCaptureStorageLocation
    A storage_location block as defined below. Changing this forces a new resource to be created.
    targetResourceId string
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters PacketCaptureFilter[]
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximumBytesPerPacket number
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximumBytesPerSession number
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximumCaptureDuration number
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name string
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    network_watcher_name str
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resource_group_name str
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storage_location PacketCaptureStorageLocationArgs
    A storage_location block as defined below. Changing this forces a new resource to be created.
    target_resource_id str
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters Sequence[PacketCaptureFilterArgs]
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximum_bytes_per_packet int
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximum_bytes_per_session int
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximum_capture_duration int
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name str
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storageLocation Property Map
    A storage_location block as defined below. Changing this forces a new resource to be created.
    targetResourceId String
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters List<Property Map>
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximumBytesPerPacket Number
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximumBytesPerSession Number
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximumCaptureDuration Number
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name String
    The name to use for this Packet Capture. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PacketCapture resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PacketCapture Resource

    Get an existing PacketCapture resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PacketCaptureState, opts?: CustomResourceOptions): PacketCapture
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            filters: Optional[Sequence[PacketCaptureFilterArgs]] = None,
            maximum_bytes_per_packet: Optional[int] = None,
            maximum_bytes_per_session: Optional[int] = None,
            maximum_capture_duration: Optional[int] = None,
            name: Optional[str] = None,
            network_watcher_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            storage_location: Optional[PacketCaptureStorageLocationArgs] = None,
            target_resource_id: Optional[str] = None) -> PacketCapture
    func GetPacketCapture(ctx *Context, name string, id IDInput, state *PacketCaptureState, opts ...ResourceOption) (*PacketCapture, error)
    public static PacketCapture Get(string name, Input<string> id, PacketCaptureState? state, CustomResourceOptions? opts = null)
    public static PacketCapture get(String name, Output<String> id, PacketCaptureState state, CustomResourceOptions options)
    resources:  _:    type: azure:network:PacketCapture    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Filters List<PacketCaptureFilter>
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    MaximumBytesPerPacket int
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    MaximumBytesPerSession int
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    MaximumCaptureDuration int
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    Name string
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    StorageLocation PacketCaptureStorageLocation
    A storage_location block as defined below. Changing this forces a new resource to be created.
    TargetResourceId string
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    Filters []PacketCaptureFilterArgs
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    MaximumBytesPerPacket int
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    MaximumBytesPerSession int
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    MaximumCaptureDuration int
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    Name string
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    StorageLocation PacketCaptureStorageLocationArgs
    A storage_location block as defined below. Changing this forces a new resource to be created.
    TargetResourceId string
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters List<PacketCaptureFilter>
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximumBytesPerPacket Integer
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximumBytesPerSession Integer
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximumCaptureDuration Integer
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name String
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storageLocation PacketCaptureStorageLocation
    A storage_location block as defined below. Changing this forces a new resource to be created.
    targetResourceId String
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters PacketCaptureFilter[]
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximumBytesPerPacket number
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximumBytesPerSession number
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximumCaptureDuration number
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name string
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    networkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storageLocation PacketCaptureStorageLocation
    A storage_location block as defined below. Changing this forces a new resource to be created.
    targetResourceId string
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters Sequence[PacketCaptureFilterArgs]
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximum_bytes_per_packet int
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximum_bytes_per_session int
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximum_capture_duration int
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name str
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    network_watcher_name str
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resource_group_name str
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storage_location PacketCaptureStorageLocationArgs
    A storage_location block as defined below. Changing this forces a new resource to be created.
    target_resource_id str
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.
    filters List<Property Map>
    One or more filter blocks as defined below. Changing this forces a new resource to be created.
    maximumBytesPerPacket Number
    The number of bytes captured per packet. The remaining bytes are truncated. Defaults to 0 (Entire Packet Captured). Changing this forces a new resource to be created.
    maximumBytesPerSession Number
    Maximum size of the capture in Bytes. Defaults to 1073741824 (1GB). Changing this forces a new resource to be created.
    maximumCaptureDuration Number
    The maximum duration of the capture session in seconds. Defaults to 18000 (5 hours). Changing this forces a new resource to be created.
    name String
    The name to use for this Packet Capture. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher exists. Changing this forces a new resource to be created.
    storageLocation Property Map
    A storage_location block as defined below. Changing this forces a new resource to be created.
    targetResourceId String
    The ID of the Resource to capture packets from. Changing this forces a new resource to be created.

    Supporting Types

    PacketCaptureFilter, PacketCaptureFilterArgs

    Protocol string
    The Protocol to be filtered on. Possible values include Any, TCP and UDP. Changing this forces a new resource to be created.
    LocalIpAddress string
    The 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. Changing this forces a new resource to be created.
    LocalPort string
    The 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. Changing this forces a new resource to be created.
    RemoteIpAddress string
    The remote 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.. Changing this forces a new resource to be created.
    RemotePort string
    The 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. Changing this forces a new resource to be created.
    Protocol string
    The Protocol to be filtered on. Possible values include Any, TCP and UDP. Changing this forces a new resource to be created.
    LocalIpAddress string
    The 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. Changing this forces a new resource to be created.
    LocalPort string
    The 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. Changing this forces a new resource to be created.
    RemoteIpAddress string
    The remote 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.. Changing this forces a new resource to be created.
    RemotePort string
    The 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. Changing this forces a new resource to be created.
    protocol String
    The Protocol to be filtered on. Possible values include Any, TCP and UDP. Changing this forces a new resource to be created.
    localIpAddress String
    The 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. Changing this forces a new resource to be created.
    localPort String
    The 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. Changing this forces a new resource to be created.
    remoteIpAddress String
    The remote 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.. Changing this forces a new resource to be created.
    remotePort String
    The 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. Changing this forces a new resource to be created.
    protocol string
    The Protocol to be filtered on. Possible values include Any, TCP and UDP. Changing this forces a new resource to be created.
    localIpAddress string
    The 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. Changing this forces a new resource to be created.
    localPort string
    The 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. Changing this forces a new resource to be created.
    remoteIpAddress string
    The remote 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.. Changing this forces a new resource to be created.
    remotePort string
    The 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. Changing this forces a new resource to be created.
    protocol str
    The Protocol to be filtered on. Possible values include Any, TCP and UDP. Changing this forces a new resource to be created.
    local_ip_address str
    The 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. Changing this forces a new resource to be created.
    local_port str
    The 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. Changing this forces a new resource to be created.
    remote_ip_address str
    The remote 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.. Changing this forces a new resource to be created.
    remote_port str
    The 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. Changing this forces a new resource to be created.
    protocol String
    The Protocol to be filtered on. Possible values include Any, TCP and UDP. Changing this forces a new resource to be created.
    localIpAddress String
    The 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. Changing this forces a new resource to be created.
    localPort String
    The 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. Changing this forces a new resource to be created.
    remoteIpAddress String
    The remote 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.. Changing this forces a new resource to be created.
    remotePort String
    The 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. Changing this forces a new resource to be created.

    PacketCaptureStorageLocation, PacketCaptureStorageLocationArgs

    FilePath string
    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.
    StorageAccountId string
    The ID of the storage account to save the packet capture session
    StoragePath string
    The URI of the storage path to save the packet capture.
    FilePath string
    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.
    StorageAccountId string
    The ID of the storage account to save the packet capture session
    StoragePath string
    The URI of the storage path to save the packet capture.
    filePath String
    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.
    storageAccountId String
    The ID of the storage account to save the packet capture session
    storagePath String
    The URI of the storage path to save the packet capture.
    filePath string
    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.
    storageAccountId string
    The ID of the storage account to save the packet capture session
    storagePath string
    The URI of the storage path to save the packet capture.
    file_path str
    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.
    storage_account_id str
    The ID of the storage account to save the packet capture session
    storage_path str
    The URI of the storage path to save the packet capture.
    filePath String
    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.
    storageAccountId String
    The ID of the storage account to save the packet capture session
    storagePath String
    The URI of the storage path to save the packet capture.

    Import

    Packet Captures can be imported using the resource id, e.g.

     $ pulumi import azure:network/packetCapture:PacketCapture capture1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkWatchers/watcher1/packetCaptures/capture1
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.