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

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

    Manages a Network Interface.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
            {
                AddressSpaces = 
                {
                    "10.0.0.0/16",
                },
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
            });
            var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new Azure.Network.SubnetArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                VirtualNetworkName = exampleVirtualNetwork.Name,
                AddressPrefixes = 
                {
                    "10.0.2.0/24",
                },
            });
            var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new Azure.Network.NetworkInterfaceArgs
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                IpConfigurations = 
                {
                    new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
                    {
                        Name = "internal",
                        SubnetId = exampleSubnet.Id,
                        PrivateIpAddressAllocation = "Dynamic",
                    },
                },
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    		})
    		if err != nil {
    			return err
    		}
    		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
    			ResourceGroupName:  exampleResourceGroup.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.0.2.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
    				&network.NetworkInterfaceIpConfigurationArgs{
    					Name:                       pulumi.String("internal"),
    					SubnetId:                   exampleSubnet.ID(),
    					PrivateIpAddressAllocation: pulumi.String("Dynamic"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    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 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: "internal",
            subnetId: exampleSubnet.id,
            privateIpAddressAllocation: "Dynamic",
        }],
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
        address_spaces=["10.0.0.0/16"],
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name)
    example_subnet = azure.network.Subnet("exampleSubnet",
        resource_group_name=example_resource_group.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.0.2.0/24"])
    example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs(
            name="internal",
            subnet_id=example_subnet.id,
            private_ip_address_allocation="Dynamic",
        )])
    

    Example coming soon!

    Create NetworkInterface Resource

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

    Constructor syntax

    new NetworkInterface(name: string, args: NetworkInterfaceArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkInterface(resource_name: str,
                         args: NetworkInterfaceArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkInterface(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         ip_configurations: Optional[Sequence[NetworkInterfaceIpConfigurationArgs]] = None,
                         resource_group_name: Optional[str] = None,
                         dns_servers: Optional[Sequence[str]] = None,
                         enable_accelerated_networking: Optional[bool] = None,
                         enable_ip_forwarding: Optional[bool] = None,
                         internal_dns_name_label: Optional[str] = None,
                         location: Optional[str] = None,
                         name: Optional[str] = None,
                         tags: Optional[Mapping[str, str]] = None)
    func NewNetworkInterface(ctx *Context, name string, args NetworkInterfaceArgs, opts ...ResourceOption) (*NetworkInterface, error)
    public NetworkInterface(string name, NetworkInterfaceArgs args, CustomResourceOptions? opts = null)
    public NetworkInterface(String name, NetworkInterfaceArgs args)
    public NetworkInterface(String name, NetworkInterfaceArgs args, CustomResourceOptions options)
    
    type: azure:network:NetworkInterface
    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 NetworkInterfaceArgs
    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 NetworkInterfaceArgs
    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 NetworkInterfaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkInterfaceArgs
    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 networkInterfaceResource = new Azure.Network.NetworkInterface("networkInterfaceResource", new()
    {
        IpConfigurations = new[]
        {
            new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
            {
                Name = "string",
                PrivateIpAddressAllocation = "string",
                GatewayLoadBalancerFrontendIpConfigurationId = "string",
                Primary = false,
                PrivateIpAddress = "string",
                PrivateIpAddressVersion = "string",
                PublicIpAddressId = "string",
                SubnetId = "string",
            },
        },
        ResourceGroupName = "string",
        DnsServers = new[]
        {
            "string",
        },
        EnableAcceleratedNetworking = false,
        EnableIpForwarding = false,
        InternalDnsNameLabel = "string",
        Location = "string",
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := network.NewNetworkInterface(ctx, "networkInterfaceResource", &network.NetworkInterfaceArgs{
    	IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
    		&network.NetworkInterfaceIpConfigurationArgs{
    			Name:                       pulumi.String("string"),
    			PrivateIpAddressAllocation: pulumi.String("string"),
    			GatewayLoadBalancerFrontendIpConfigurationId: pulumi.String("string"),
    			Primary:                 pulumi.Bool(false),
    			PrivateIpAddress:        pulumi.String("string"),
    			PrivateIpAddressVersion: pulumi.String("string"),
    			PublicIpAddressId:       pulumi.String("string"),
    			SubnetId:                pulumi.String("string"),
    		},
    	},
    	ResourceGroupName: pulumi.String("string"),
    	DnsServers: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	EnableAcceleratedNetworking: pulumi.Bool(false),
    	EnableIpForwarding:          pulumi.Bool(false),
    	InternalDnsNameLabel:        pulumi.String("string"),
    	Location:                    pulumi.String("string"),
    	Name:                        pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var networkInterfaceResource = new NetworkInterface("networkInterfaceResource", NetworkInterfaceArgs.builder()
        .ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
            .name("string")
            .privateIpAddressAllocation("string")
            .gatewayLoadBalancerFrontendIpConfigurationId("string")
            .primary(false)
            .privateIpAddress("string")
            .privateIpAddressVersion("string")
            .publicIpAddressId("string")
            .subnetId("string")
            .build())
        .resourceGroupName("string")
        .dnsServers("string")
        .enableAcceleratedNetworking(false)
        .enableIpForwarding(false)
        .internalDnsNameLabel("string")
        .location("string")
        .name("string")
        .tags(Map.of("string", "string"))
        .build());
    
    network_interface_resource = azure.network.NetworkInterface("networkInterfaceResource",
        ip_configurations=[{
            "name": "string",
            "private_ip_address_allocation": "string",
            "gateway_load_balancer_frontend_ip_configuration_id": "string",
            "primary": False,
            "private_ip_address": "string",
            "private_ip_address_version": "string",
            "public_ip_address_id": "string",
            "subnet_id": "string",
        }],
        resource_group_name="string",
        dns_servers=["string"],
        enable_accelerated_networking=False,
        enable_ip_forwarding=False,
        internal_dns_name_label="string",
        location="string",
        name="string",
        tags={
            "string": "string",
        })
    
    const networkInterfaceResource = new azure.network.NetworkInterface("networkInterfaceResource", {
        ipConfigurations: [{
            name: "string",
            privateIpAddressAllocation: "string",
            gatewayLoadBalancerFrontendIpConfigurationId: "string",
            primary: false,
            privateIpAddress: "string",
            privateIpAddressVersion: "string",
            publicIpAddressId: "string",
            subnetId: "string",
        }],
        resourceGroupName: "string",
        dnsServers: ["string"],
        enableAcceleratedNetworking: false,
        enableIpForwarding: false,
        internalDnsNameLabel: "string",
        location: "string",
        name: "string",
        tags: {
            string: "string",
        },
    });
    
    type: azure:network:NetworkInterface
    properties:
        dnsServers:
            - string
        enableAcceleratedNetworking: false
        enableIpForwarding: false
        internalDnsNameLabel: string
        ipConfigurations:
            - gatewayLoadBalancerFrontendIpConfigurationId: string
              name: string
              primary: false
              privateIpAddress: string
              privateIpAddressAllocation: string
              privateIpAddressVersion: string
              publicIpAddressId: string
              subnetId: string
        location: string
        name: string
        resourceGroupName: string
        tags:
            string: string
    

    NetworkInterface 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 NetworkInterface resource accepts the following input properties:

    IpConfigurations List<NetworkInterfaceIpConfiguration>
    One or more ip_configuration blocks as defined below.
    ResourceGroupName string
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    DnsServers List<string>
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    EnableAcceleratedNetworking bool
    Should Accelerated Networking be enabled? Defaults to false.
    EnableIpForwarding bool
    Should IP Forwarding be enabled? Defaults to false.
    InternalDnsNameLabel string
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    Location string
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Network Interface. Changing this forces a new resource to be created.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    IpConfigurations []NetworkInterfaceIpConfigurationArgs
    One or more ip_configuration blocks as defined below.
    ResourceGroupName string
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    DnsServers []string
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    EnableAcceleratedNetworking bool
    Should Accelerated Networking be enabled? Defaults to false.
    EnableIpForwarding bool
    Should IP Forwarding be enabled? Defaults to false.
    InternalDnsNameLabel string
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    Location string
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Network Interface. Changing this forces a new resource to be created.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    ipConfigurations List<NetworkInterfaceIpConfiguration>
    One or more ip_configuration blocks as defined below.
    resourceGroupName String
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    dnsServers List<String>
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enableAcceleratedNetworking Boolean
    Should Accelerated Networking be enabled? Defaults to false.
    enableIpForwarding Boolean
    Should IP Forwarding be enabled? Defaults to false.
    internalDnsNameLabel String
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    location String
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    name String
    The name of the Network Interface. Changing this forces a new resource to be created.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    ipConfigurations NetworkInterfaceIpConfiguration[]
    One or more ip_configuration blocks as defined below.
    resourceGroupName string
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    dnsServers string[]
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enableAcceleratedNetworking boolean
    Should Accelerated Networking be enabled? Defaults to false.
    enableIpForwarding boolean
    Should IP Forwarding be enabled? Defaults to false.
    internalDnsNameLabel string
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    location string
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    name string
    The name of the Network Interface. Changing this forces a new resource to be created.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    ip_configurations Sequence[NetworkInterfaceIpConfigurationArgs]
    One or more ip_configuration blocks as defined below.
    resource_group_name str
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    dns_servers Sequence[str]
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enable_accelerated_networking bool
    Should Accelerated Networking be enabled? Defaults to false.
    enable_ip_forwarding bool
    Should IP Forwarding be enabled? Defaults to false.
    internal_dns_name_label str
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    location str
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    name str
    The name of the Network Interface. Changing this forces a new resource to be created.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    ipConfigurations List<Property Map>
    One or more ip_configuration blocks as defined below.
    resourceGroupName String
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    dnsServers List<String>
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enableAcceleratedNetworking Boolean
    Should Accelerated Networking be enabled? Defaults to false.
    enableIpForwarding Boolean
    Should IP Forwarding be enabled? Defaults to false.
    internalDnsNameLabel String
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    location String
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    name String
    The name of the Network Interface. Changing this forces a new resource to be created.
    tags Map<String>
    A mapping of tags to assign to the resource.

    Outputs

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

    AppliedDnsServers List<string>
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    Id string
    The provider-assigned unique ID for this managed resource.
    InternalDomainNameSuffix string
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    MacAddress string
    The Media Access Control (MAC) Address of the Network Interface.
    PrivateIpAddress string
    The Static IP Address which should be used.
    PrivateIpAddresses List<string>
    The private IP addresses of the network interface.
    VirtualMachineId string
    The ID of the Virtual Machine which this Network Interface is connected to.
    AppliedDnsServers []string
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    Id string
    The provider-assigned unique ID for this managed resource.
    InternalDomainNameSuffix string
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    MacAddress string
    The Media Access Control (MAC) Address of the Network Interface.
    PrivateIpAddress string
    The Static IP Address which should be used.
    PrivateIpAddresses []string
    The private IP addresses of the network interface.
    VirtualMachineId string
    The ID of the Virtual Machine which this Network Interface is connected to.
    appliedDnsServers List<String>
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    id String
    The provider-assigned unique ID for this managed resource.
    internalDomainNameSuffix String
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    macAddress String
    The Media Access Control (MAC) Address of the Network Interface.
    privateIpAddress String
    The Static IP Address which should be used.
    privateIpAddresses List<String>
    The private IP addresses of the network interface.
    virtualMachineId String
    The ID of the Virtual Machine which this Network Interface is connected to.
    appliedDnsServers string[]
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    id string
    The provider-assigned unique ID for this managed resource.
    internalDomainNameSuffix string
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    macAddress string
    The Media Access Control (MAC) Address of the Network Interface.
    privateIpAddress string
    The Static IP Address which should be used.
    privateIpAddresses string[]
    The private IP addresses of the network interface.
    virtualMachineId string
    The ID of the Virtual Machine which this Network Interface is connected to.
    applied_dns_servers Sequence[str]
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    id str
    The provider-assigned unique ID for this managed resource.
    internal_domain_name_suffix str
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    mac_address str
    The Media Access Control (MAC) Address of the Network Interface.
    private_ip_address str
    The Static IP Address which should be used.
    private_ip_addresses Sequence[str]
    The private IP addresses of the network interface.
    virtual_machine_id str
    The ID of the Virtual Machine which this Network Interface is connected to.
    appliedDnsServers List<String>
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    id String
    The provider-assigned unique ID for this managed resource.
    internalDomainNameSuffix String
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    macAddress String
    The Media Access Control (MAC) Address of the Network Interface.
    privateIpAddress String
    The Static IP Address which should be used.
    privateIpAddresses List<String>
    The private IP addresses of the network interface.
    virtualMachineId String
    The ID of the Virtual Machine which this Network Interface is connected to.

    Look up Existing NetworkInterface Resource

    Get an existing NetworkInterface 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?: NetworkInterfaceState, opts?: CustomResourceOptions): NetworkInterface
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            applied_dns_servers: Optional[Sequence[str]] = None,
            dns_servers: Optional[Sequence[str]] = None,
            enable_accelerated_networking: Optional[bool] = None,
            enable_ip_forwarding: Optional[bool] = None,
            internal_dns_name_label: Optional[str] = None,
            internal_domain_name_suffix: Optional[str] = None,
            ip_configurations: Optional[Sequence[NetworkInterfaceIpConfigurationArgs]] = None,
            location: Optional[str] = None,
            mac_address: Optional[str] = None,
            name: Optional[str] = None,
            private_ip_address: Optional[str] = None,
            private_ip_addresses: Optional[Sequence[str]] = None,
            resource_group_name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            virtual_machine_id: Optional[str] = None) -> NetworkInterface
    func GetNetworkInterface(ctx *Context, name string, id IDInput, state *NetworkInterfaceState, opts ...ResourceOption) (*NetworkInterface, error)
    public static NetworkInterface Get(string name, Input<string> id, NetworkInterfaceState? state, CustomResourceOptions? opts = null)
    public static NetworkInterface get(String name, Output<String> id, NetworkInterfaceState state, CustomResourceOptions options)
    resources:  _:    type: azure:network:NetworkInterface    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:
    AppliedDnsServers List<string>
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    DnsServers List<string>
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    EnableAcceleratedNetworking bool
    Should Accelerated Networking be enabled? Defaults to false.
    EnableIpForwarding bool
    Should IP Forwarding be enabled? Defaults to false.
    InternalDnsNameLabel string
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    InternalDomainNameSuffix string
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    IpConfigurations List<NetworkInterfaceIpConfiguration>
    One or more ip_configuration blocks as defined below.
    Location string
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    MacAddress string
    The Media Access Control (MAC) Address of the Network Interface.
    Name string
    The name of the Network Interface. Changing this forces a new resource to be created.
    PrivateIpAddress string
    The Static IP Address which should be used.
    PrivateIpAddresses List<string>
    The private IP addresses of the network interface.
    ResourceGroupName string
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    VirtualMachineId string
    The ID of the Virtual Machine which this Network Interface is connected to.
    AppliedDnsServers []string
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    DnsServers []string
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    EnableAcceleratedNetworking bool
    Should Accelerated Networking be enabled? Defaults to false.
    EnableIpForwarding bool
    Should IP Forwarding be enabled? Defaults to false.
    InternalDnsNameLabel string
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    InternalDomainNameSuffix string
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    IpConfigurations []NetworkInterfaceIpConfigurationArgs
    One or more ip_configuration blocks as defined below.
    Location string
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    MacAddress string
    The Media Access Control (MAC) Address of the Network Interface.
    Name string
    The name of the Network Interface. Changing this forces a new resource to be created.
    PrivateIpAddress string
    The Static IP Address which should be used.
    PrivateIpAddresses []string
    The private IP addresses of the network interface.
    ResourceGroupName string
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    VirtualMachineId string
    The ID of the Virtual Machine which this Network Interface is connected to.
    appliedDnsServers List<String>
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    dnsServers List<String>
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enableAcceleratedNetworking Boolean
    Should Accelerated Networking be enabled? Defaults to false.
    enableIpForwarding Boolean
    Should IP Forwarding be enabled? Defaults to false.
    internalDnsNameLabel String
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    internalDomainNameSuffix String
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    ipConfigurations List<NetworkInterfaceIpConfiguration>
    One or more ip_configuration blocks as defined below.
    location String
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    macAddress String
    The Media Access Control (MAC) Address of the Network Interface.
    name String
    The name of the Network Interface. Changing this forces a new resource to be created.
    privateIpAddress String
    The Static IP Address which should be used.
    privateIpAddresses List<String>
    The private IP addresses of the network interface.
    resourceGroupName String
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    virtualMachineId String
    The ID of the Virtual Machine which this Network Interface is connected to.
    appliedDnsServers string[]
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    dnsServers string[]
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enableAcceleratedNetworking boolean
    Should Accelerated Networking be enabled? Defaults to false.
    enableIpForwarding boolean
    Should IP Forwarding be enabled? Defaults to false.
    internalDnsNameLabel string
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    internalDomainNameSuffix string
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    ipConfigurations NetworkInterfaceIpConfiguration[]
    One or more ip_configuration blocks as defined below.
    location string
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    macAddress string
    The Media Access Control (MAC) Address of the Network Interface.
    name string
    The name of the Network Interface. Changing this forces a new resource to be created.
    privateIpAddress string
    The Static IP Address which should be used.
    privateIpAddresses string[]
    The private IP addresses of the network interface.
    resourceGroupName string
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    virtualMachineId string
    The ID of the Virtual Machine which this Network Interface is connected to.
    applied_dns_servers Sequence[str]
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    dns_servers Sequence[str]
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enable_accelerated_networking bool
    Should Accelerated Networking be enabled? Defaults to false.
    enable_ip_forwarding bool
    Should IP Forwarding be enabled? Defaults to false.
    internal_dns_name_label str
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    internal_domain_name_suffix str
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    ip_configurations Sequence[NetworkInterfaceIpConfigurationArgs]
    One or more ip_configuration blocks as defined below.
    location str
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    mac_address str
    The Media Access Control (MAC) Address of the Network Interface.
    name str
    The name of the Network Interface. Changing this forces a new resource to be created.
    private_ip_address str
    The Static IP Address which should be used.
    private_ip_addresses Sequence[str]
    The private IP addresses of the network interface.
    resource_group_name str
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    virtual_machine_id str
    The ID of the Virtual Machine which this Network Interface is connected to.
    appliedDnsServers List<String>
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    dnsServers List<String>
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    enableAcceleratedNetworking Boolean
    Should Accelerated Networking be enabled? Defaults to false.
    enableIpForwarding Boolean
    Should IP Forwarding be enabled? Defaults to false.
    internalDnsNameLabel String
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    internalDomainNameSuffix String
    Even if internal_dns_name_label is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internal_domain_name_suffix.
    ipConfigurations List<Property Map>
    One or more ip_configuration blocks as defined below.
    location String
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    macAddress String
    The Media Access Control (MAC) Address of the Network Interface.
    name String
    The name of the Network Interface. Changing this forces a new resource to be created.
    privateIpAddress String
    The Static IP Address which should be used.
    privateIpAddresses List<String>
    The private IP addresses of the network interface.
    resourceGroupName String
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    tags Map<String>
    A mapping of tags to assign to the resource.
    virtualMachineId String
    The ID of the Virtual Machine which this Network Interface is connected to.

    Supporting Types

    NetworkInterfaceIpConfiguration, NetworkInterfaceIpConfigurationArgs

    Name string
    A name used for this IP Configuration.
    PrivateIpAddressAllocation string
    The allocation method used for the Private IP Address. Possible values are Dynamic and Static.
    GatewayLoadBalancerFrontendIpConfigurationId string
    The Frontend IP Configuration ID of a Gateway Sku Load Balancer.
    Primary bool
    Is this the Primary IP Configuration? Must be true for the first ip_configuration when multiple are specified. Defaults to false.
    PrivateIpAddress string
    The Static IP Address which should be used.
    PrivateIpAddressVersion string
    The IP Version to use. Possible values are IPv4 or IPv6. Defaults to IPv4.
    PublicIpAddressId string
    Reference to a Public IP Address to associate with this NIC
    SubnetId string
    The ID of the Subnet where this Network Interface should be located in.
    Name string
    A name used for this IP Configuration.
    PrivateIpAddressAllocation string
    The allocation method used for the Private IP Address. Possible values are Dynamic and Static.
    GatewayLoadBalancerFrontendIpConfigurationId string
    The Frontend IP Configuration ID of a Gateway Sku Load Balancer.
    Primary bool
    Is this the Primary IP Configuration? Must be true for the first ip_configuration when multiple are specified. Defaults to false.
    PrivateIpAddress string
    The Static IP Address which should be used.
    PrivateIpAddressVersion string
    The IP Version to use. Possible values are IPv4 or IPv6. Defaults to IPv4.
    PublicIpAddressId string
    Reference to a Public IP Address to associate with this NIC
    SubnetId string
    The ID of the Subnet where this Network Interface should be located in.
    name String
    A name used for this IP Configuration.
    privateIpAddressAllocation String
    The allocation method used for the Private IP Address. Possible values are Dynamic and Static.
    gatewayLoadBalancerFrontendIpConfigurationId String
    The Frontend IP Configuration ID of a Gateway Sku Load Balancer.
    primary Boolean
    Is this the Primary IP Configuration? Must be true for the first ip_configuration when multiple are specified. Defaults to false.
    privateIpAddress String
    The Static IP Address which should be used.
    privateIpAddressVersion String
    The IP Version to use. Possible values are IPv4 or IPv6. Defaults to IPv4.
    publicIpAddressId String
    Reference to a Public IP Address to associate with this NIC
    subnetId String
    The ID of the Subnet where this Network Interface should be located in.
    name string
    A name used for this IP Configuration.
    privateIpAddressAllocation string
    The allocation method used for the Private IP Address. Possible values are Dynamic and Static.
    gatewayLoadBalancerFrontendIpConfigurationId string
    The Frontend IP Configuration ID of a Gateway Sku Load Balancer.
    primary boolean
    Is this the Primary IP Configuration? Must be true for the first ip_configuration when multiple are specified. Defaults to false.
    privateIpAddress string
    The Static IP Address which should be used.
    privateIpAddressVersion string
    The IP Version to use. Possible values are IPv4 or IPv6. Defaults to IPv4.
    publicIpAddressId string
    Reference to a Public IP Address to associate with this NIC
    subnetId string
    The ID of the Subnet where this Network Interface should be located in.
    name str
    A name used for this IP Configuration.
    private_ip_address_allocation str
    The allocation method used for the Private IP Address. Possible values are Dynamic and Static.
    gateway_load_balancer_frontend_ip_configuration_id str
    The Frontend IP Configuration ID of a Gateway Sku Load Balancer.
    primary bool
    Is this the Primary IP Configuration? Must be true for the first ip_configuration when multiple are specified. Defaults to false.
    private_ip_address str
    The Static IP Address which should be used.
    private_ip_address_version str
    The IP Version to use. Possible values are IPv4 or IPv6. Defaults to IPv4.
    public_ip_address_id str
    Reference to a Public IP Address to associate with this NIC
    subnet_id str
    The ID of the Subnet where this Network Interface should be located in.
    name String
    A name used for this IP Configuration.
    privateIpAddressAllocation String
    The allocation method used for the Private IP Address. Possible values are Dynamic and Static.
    gatewayLoadBalancerFrontendIpConfigurationId String
    The Frontend IP Configuration ID of a Gateway Sku Load Balancer.
    primary Boolean
    Is this the Primary IP Configuration? Must be true for the first ip_configuration when multiple are specified. Defaults to false.
    privateIpAddress String
    The Static IP Address which should be used.
    privateIpAddressVersion String
    The IP Version to use. Possible values are IPv4 or IPv6. Defaults to IPv4.
    publicIpAddressId String
    Reference to a Public IP Address to associate with this NIC
    subnetId String
    The ID of the Subnet where this Network Interface should be located in.

    Import

    Network Interfaces can be imported using the resource id, e.g.

     $ pulumi import azure:network/networkInterface:NetworkInterface example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkInterfaces/nic1
    

    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.