We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.network.getNetworkInterface
Use this data source to access information about an existing Network Interface.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.network.getNetworkInterface({
name: "acctest-nic",
resourceGroupName: "networking",
});
export const networkInterfaceId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.network.get_network_interface(name="acctest-nic",
resource_group_name="networking")
pulumi.export("networkInterfaceId", example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := network.LookupNetworkInterface(ctx, &network.LookupNetworkInterfaceArgs{
Name: "acctest-nic",
ResourceGroupName: "networking",
}, nil)
if err != nil {
return err
}
ctx.Export("networkInterfaceId", example.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Network.GetNetworkInterface.Invoke(new()
{
Name = "acctest-nic",
ResourceGroupName = "networking",
});
return new Dictionary<string, object?>
{
["networkInterfaceId"] = example.Apply(getNetworkInterfaceResult => getNetworkInterfaceResult.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.network.NetworkFunctions;
import com.pulumi.azure.network.inputs.GetNetworkInterfaceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = NetworkFunctions.getNetworkInterface(GetNetworkInterfaceArgs.builder()
.name("acctest-nic")
.resourceGroupName("networking")
.build());
ctx.export("networkInterfaceId", example.id());
}
}
variables:
example:
fn::invoke:
function: azure:network:getNetworkInterface
arguments:
name: acctest-nic
resourceGroupName: networking
outputs:
networkInterfaceId: ${example.id}
API Providers
This data source uses the following Azure API Providers:
Microsoft.Network- 2024-05-01
Using getNetworkInterface
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNetworkInterface(args: GetNetworkInterfaceArgs, opts?: InvokeOptions): Promise<GetNetworkInterfaceResult>
function getNetworkInterfaceOutput(args: GetNetworkInterfaceOutputArgs, opts?: InvokeOptions): Output<GetNetworkInterfaceResult>def get_network_interface(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNetworkInterfaceResult
def get_network_interface_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNetworkInterfaceResult]func LookupNetworkInterface(ctx *Context, args *LookupNetworkInterfaceArgs, opts ...InvokeOption) (*LookupNetworkInterfaceResult, error)
func LookupNetworkInterfaceOutput(ctx *Context, args *LookupNetworkInterfaceOutputArgs, opts ...InvokeOption) LookupNetworkInterfaceResultOutput> Note: This function is named LookupNetworkInterface in the Go SDK.
public static class GetNetworkInterface
{
public static Task<GetNetworkInterfaceResult> InvokeAsync(GetNetworkInterfaceArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkInterfaceResult> Invoke(GetNetworkInterfaceInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNetworkInterfaceResult> getNetworkInterface(GetNetworkInterfaceArgs args, InvokeOptions options)
public static Output<GetNetworkInterfaceResult> getNetworkInterface(GetNetworkInterfaceArgs args, InvokeOptions options)
fn::invoke:
function: azure:network/getNetworkInterface:getNetworkInterface
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the Network Interface.
- Resource
Group stringName - Specifies the name of the resource group the Network Interface is located in.
- Name string
- Specifies the name of the Network Interface.
- Resource
Group stringName - Specifies the name of the resource group the Network Interface is located in.
- name String
- Specifies the name of the Network Interface.
- resource
Group StringName - Specifies the name of the resource group the Network Interface is located in.
- name string
- Specifies the name of the Network Interface.
- resource
Group stringName - Specifies the name of the resource group the Network Interface is located in.
- name str
- Specifies the name of the Network Interface.
- resource_
group_ strname - Specifies the name of the resource group the Network Interface is located in.
- name String
- Specifies the name of the Network Interface.
- resource
Group StringName - Specifies the name of the resource group the Network Interface is located in.
getNetworkInterface Result
The following output properties are available:
- Accelerated
Networking boolEnabled - Indicates if accelerated networking is set on the specified Network Interface.
- Applied
Dns List<string>Servers - List of DNS servers applied to the specified Network Interface.
- Dns
Servers List<string> - The list of DNS servers used by the specified Network Interface.
- Id string
- The provider-assigned unique ID for this managed resource.
- Internal
Dns stringName Label - The internal DNS name label of the specified Network Interface.
- Ip
Configurations List<GetNetwork Interface Ip Configuration> - One or more
ip_configurationblocks as defined below. - Ip
Forwarding boolEnabled - Indicate if IP forwarding is set on the specified Network Interface.
- Location string
- The location of the specified Network Interface.
- Mac
Address string - The MAC address used by the specified Network Interface.
- Name string
- The name of the IP Configuration.
- Network
Security stringGroup Id - The ID of the network security group associated to the specified Network Interface.
- Private
Ip stringAddress - The Private IP Address assigned to this Network Interface.
- Private
Ip List<string>Addresses - The list of private IP addresses associates to the specified Network Interface.
- Resource
Group stringName - Dictionary<string, string>
- List the tags associated to the specified Network Interface.
- Virtual
Machine stringId - The ID of the virtual machine that the specified Network Interface is attached to.
- Accelerated
Networking boolEnabled - Indicates if accelerated networking is set on the specified Network Interface.
- Applied
Dns []stringServers - List of DNS servers applied to the specified Network Interface.
- Dns
Servers []string - The list of DNS servers used by the specified Network Interface.
- Id string
- The provider-assigned unique ID for this managed resource.
- Internal
Dns stringName Label - The internal DNS name label of the specified Network Interface.
- Ip
Configurations []GetNetwork Interface Ip Configuration - One or more
ip_configurationblocks as defined below. - Ip
Forwarding boolEnabled - Indicate if IP forwarding is set on the specified Network Interface.
- Location string
- The location of the specified Network Interface.
- Mac
Address string - The MAC address used by the specified Network Interface.
- Name string
- The name of the IP Configuration.
- Network
Security stringGroup Id - The ID of the network security group associated to the specified Network Interface.
- Private
Ip stringAddress - The Private IP Address assigned to this Network Interface.
- Private
Ip []stringAddresses - The list of private IP addresses associates to the specified Network Interface.
- Resource
Group stringName - map[string]string
- List the tags associated to the specified Network Interface.
- Virtual
Machine stringId - The ID of the virtual machine that the specified Network Interface is attached to.
- accelerated
Networking BooleanEnabled - Indicates if accelerated networking is set on the specified Network Interface.
- applied
Dns List<String>Servers - List of DNS servers applied to the specified Network Interface.
- dns
Servers List<String> - The list of DNS servers used by the specified Network Interface.
- id String
- The provider-assigned unique ID for this managed resource.
- internal
Dns StringName Label - The internal DNS name label of the specified Network Interface.
- ip
Configurations List<GetNetwork Interface Ip Configuration> - One or more
ip_configurationblocks as defined below. - ip
Forwarding BooleanEnabled - Indicate if IP forwarding is set on the specified Network Interface.
- location String
- The location of the specified Network Interface.
- mac
Address String - The MAC address used by the specified Network Interface.
- name String
- The name of the IP Configuration.
- network
Security StringGroup Id - The ID of the network security group associated to the specified Network Interface.
- private
Ip StringAddress - The Private IP Address assigned to this Network Interface.
- private
Ip List<String>Addresses - The list of private IP addresses associates to the specified Network Interface.
- resource
Group StringName - Map<String,String>
- List the tags associated to the specified Network Interface.
- virtual
Machine StringId - The ID of the virtual machine that the specified Network Interface is attached to.
- accelerated
Networking booleanEnabled - Indicates if accelerated networking is set on the specified Network Interface.
- applied
Dns string[]Servers - List of DNS servers applied to the specified Network Interface.
- dns
Servers string[] - The list of DNS servers used by the specified Network Interface.
- id string
- The provider-assigned unique ID for this managed resource.
- internal
Dns stringName Label - The internal DNS name label of the specified Network Interface.
- ip
Configurations GetNetwork Interface Ip Configuration[] - One or more
ip_configurationblocks as defined below. - ip
Forwarding booleanEnabled - Indicate if IP forwarding is set on the specified Network Interface.
- location string
- The location of the specified Network Interface.
- mac
Address string - The MAC address used by the specified Network Interface.
- name string
- The name of the IP Configuration.
- network
Security stringGroup Id - The ID of the network security group associated to the specified Network Interface.
- private
Ip stringAddress - The Private IP Address assigned to this Network Interface.
- private
Ip string[]Addresses - The list of private IP addresses associates to the specified Network Interface.
- resource
Group stringName - {[key: string]: string}
- List the tags associated to the specified Network Interface.
- virtual
Machine stringId - The ID of the virtual machine that the specified Network Interface is attached to.
- accelerated_
networking_ boolenabled - Indicates if accelerated networking is set on the specified Network Interface.
- applied_
dns_ Sequence[str]servers - List of DNS servers applied to the specified Network Interface.
- dns_
servers Sequence[str] - The list of DNS servers used by the specified Network Interface.
- id str
- The provider-assigned unique ID for this managed resource.
- internal_
dns_ strname_ label - The internal DNS name label of the specified Network Interface.
- ip_
configurations Sequence[GetNetwork Interface Ip Configuration] - One or more
ip_configurationblocks as defined below. - ip_
forwarding_ boolenabled - Indicate if IP forwarding is set on the specified Network Interface.
- location str
- The location of the specified Network Interface.
- mac_
address str - The MAC address used by the specified Network Interface.
- name str
- The name of the IP Configuration.
- network_
security_ strgroup_ id - The ID of the network security group associated to the specified Network Interface.
- private_
ip_ straddress - The Private IP Address assigned to this Network Interface.
- private_
ip_ Sequence[str]addresses - The list of private IP addresses associates to the specified Network Interface.
- resource_
group_ strname - Mapping[str, str]
- List the tags associated to the specified Network Interface.
- virtual_
machine_ strid - The ID of the virtual machine that the specified Network Interface is attached to.
- accelerated
Networking BooleanEnabled - Indicates if accelerated networking is set on the specified Network Interface.
- applied
Dns List<String>Servers - List of DNS servers applied to the specified Network Interface.
- dns
Servers List<String> - The list of DNS servers used by the specified Network Interface.
- id String
- The provider-assigned unique ID for this managed resource.
- internal
Dns StringName Label - The internal DNS name label of the specified Network Interface.
- ip
Configurations List<Property Map> - One or more
ip_configurationblocks as defined below. - ip
Forwarding BooleanEnabled - Indicate if IP forwarding is set on the specified Network Interface.
- location String
- The location of the specified Network Interface.
- mac
Address String - The MAC address used by the specified Network Interface.
- name String
- The name of the IP Configuration.
- network
Security StringGroup Id - The ID of the network security group associated to the specified Network Interface.
- private
Ip StringAddress - The Private IP Address assigned to this Network Interface.
- private
Ip List<String>Addresses - The list of private IP addresses associates to the specified Network Interface.
- resource
Group StringName - Map<String>
- List the tags associated to the specified Network Interface.
- virtual
Machine StringId - The ID of the virtual machine that the specified Network Interface is attached to.
Supporting Types
GetNetworkInterfaceIpConfiguration
- Application
Gateway List<string>Backend Address Pools Ids - A list of Backend Address Pool IDs within a Application Gateway that this Network Interface is connected to.
- Application
Security List<string>Group Ids - Gateway
Load stringBalancer Frontend Ip Configuration Id - The Frontend IP Configuration ID of a Gateway SKU Load Balancer the Network Interface is consuming.
- Load
Balancer List<string>Backend Address Pools Ids - A list of Backend Address Pool IDs within a Load Balancer that this Network Interface is connected to.
- Load
Balancer List<string>Inbound Nat Rules Ids - A list of Inbound NAT Rule IDs within a Load Balancer that this Network Interface is connected to.
- Name string
- Specifies the name of the Network Interface.
- Primary bool
- is this the Primary IP Configuration for this Network Interface?
- Private
Ip stringAddress - The Private IP Address assigned to this Network Interface.
- Private
Ip stringAddress Allocation - The IP Address allocation type for the Private address, such as
DynamicorStatic. - Private
Ip stringAddress Version - Public
Ip stringAddress Id - The ID of the Public IP Address which is connected to this Network Interface.
- Subnet
Id string - The ID of the Subnet which the Network Interface is connected to.
- Application
Gateway []stringBackend Address Pools Ids - A list of Backend Address Pool IDs within a Application Gateway that this Network Interface is connected to.
- Application
Security []stringGroup Ids - Gateway
Load stringBalancer Frontend Ip Configuration Id - The Frontend IP Configuration ID of a Gateway SKU Load Balancer the Network Interface is consuming.
- Load
Balancer []stringBackend Address Pools Ids - A list of Backend Address Pool IDs within a Load Balancer that this Network Interface is connected to.
- Load
Balancer []stringInbound Nat Rules Ids - A list of Inbound NAT Rule IDs within a Load Balancer that this Network Interface is connected to.
- Name string
- Specifies the name of the Network Interface.
- Primary bool
- is this the Primary IP Configuration for this Network Interface?
- Private
Ip stringAddress - The Private IP Address assigned to this Network Interface.
- Private
Ip stringAddress Allocation - The IP Address allocation type for the Private address, such as
DynamicorStatic. - Private
Ip stringAddress Version - Public
Ip stringAddress Id - The ID of the Public IP Address which is connected to this Network Interface.
- Subnet
Id string - The ID of the Subnet which the Network Interface is connected to.
- application
Gateway List<String>Backend Address Pools Ids - A list of Backend Address Pool IDs within a Application Gateway that this Network Interface is connected to.
- application
Security List<String>Group Ids - gateway
Load StringBalancer Frontend Ip Configuration Id - The Frontend IP Configuration ID of a Gateway SKU Load Balancer the Network Interface is consuming.
- load
Balancer List<String>Backend Address Pools Ids - A list of Backend Address Pool IDs within a Load Balancer that this Network Interface is connected to.
- load
Balancer List<String>Inbound Nat Rules Ids - A list of Inbound NAT Rule IDs within a Load Balancer that this Network Interface is connected to.
- name String
- Specifies the name of the Network Interface.
- primary Boolean
- is this the Primary IP Configuration for this Network Interface?
- private
Ip StringAddress - The Private IP Address assigned to this Network Interface.
- private
Ip StringAddress Allocation - The IP Address allocation type for the Private address, such as
DynamicorStatic. - private
Ip StringAddress Version - public
Ip StringAddress Id - The ID of the Public IP Address which is connected to this Network Interface.
- subnet
Id String - The ID of the Subnet which the Network Interface is connected to.
- application
Gateway string[]Backend Address Pools Ids - A list of Backend Address Pool IDs within a Application Gateway that this Network Interface is connected to.
- application
Security string[]Group Ids - gateway
Load stringBalancer Frontend Ip Configuration Id - The Frontend IP Configuration ID of a Gateway SKU Load Balancer the Network Interface is consuming.
- load
Balancer string[]Backend Address Pools Ids - A list of Backend Address Pool IDs within a Load Balancer that this Network Interface is connected to.
- load
Balancer string[]Inbound Nat Rules Ids - A list of Inbound NAT Rule IDs within a Load Balancer that this Network Interface is connected to.
- name string
- Specifies the name of the Network Interface.
- primary boolean
- is this the Primary IP Configuration for this Network Interface?
- private
Ip stringAddress - The Private IP Address assigned to this Network Interface.
- private
Ip stringAddress Allocation - The IP Address allocation type for the Private address, such as
DynamicorStatic. - private
Ip stringAddress Version - public
Ip stringAddress Id - The ID of the Public IP Address which is connected to this Network Interface.
- subnet
Id string - The ID of the Subnet which the Network Interface is connected to.
- application_
gateway_ Sequence[str]backend_ address_ pools_ ids - A list of Backend Address Pool IDs within a Application Gateway that this Network Interface is connected to.
- application_
security_ Sequence[str]group_ ids - gateway_
load_ strbalancer_ frontend_ ip_ configuration_ id - The Frontend IP Configuration ID of a Gateway SKU Load Balancer the Network Interface is consuming.
- load_
balancer_ Sequence[str]backend_ address_ pools_ ids - A list of Backend Address Pool IDs within a Load Balancer that this Network Interface is connected to.
- load_
balancer_ Sequence[str]inbound_ nat_ rules_ ids - A list of Inbound NAT Rule IDs within a Load Balancer that this Network Interface is connected to.
- name str
- Specifies the name of the Network Interface.
- primary bool
- is this the Primary IP Configuration for this Network Interface?
- private_
ip_ straddress - The Private IP Address assigned to this Network Interface.
- private_
ip_ straddress_ allocation - The IP Address allocation type for the Private address, such as
DynamicorStatic. - private_
ip_ straddress_ version - public_
ip_ straddress_ id - The ID of the Public IP Address which is connected to this Network Interface.
- subnet_
id str - The ID of the Subnet which the Network Interface is connected to.
- application
Gateway List<String>Backend Address Pools Ids - A list of Backend Address Pool IDs within a Application Gateway that this Network Interface is connected to.
- application
Security List<String>Group Ids - gateway
Load StringBalancer Frontend Ip Configuration Id - The Frontend IP Configuration ID of a Gateway SKU Load Balancer the Network Interface is consuming.
- load
Balancer List<String>Backend Address Pools Ids - A list of Backend Address Pool IDs within a Load Balancer that this Network Interface is connected to.
- load
Balancer List<String>Inbound Nat Rules Ids - A list of Inbound NAT Rule IDs within a Load Balancer that this Network Interface is connected to.
- name String
- Specifies the name of the Network Interface.
- primary Boolean
- is this the Primary IP Configuration for this Network Interface?
- private
Ip StringAddress - The Private IP Address assigned to this Network Interface.
- private
Ip StringAddress Allocation - The IP Address allocation type for the Private address, such as
DynamicorStatic. - private
Ip StringAddress Version - public
Ip StringAddress Id - The ID of the Public IP Address which is connected to this Network Interface.
- subnet
Id String - The ID of the Subnet which the Network Interface is connected to.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
