Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Network/Network/help/New-AzNetworkInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ created automatically using the name IPConfiguration1.

### Example 2: Create an Azure network interface using an IP configuration object
```
PS C:\>$IPconfig = New-AzNetworkInterfaceIpConfig -Name "IPConfig1" -PrivateIpAddressVersion IPv4 -PrivateIpAddress "10.0.1.10" -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Network/virtualNetworks/VirtualNetwork1/subnets/Subnet1"
PS C:\>$Subnet = Get-AzVirtualNetwork -Name "VirtualNetwork1" -ResourceGroupName "ResourceGroup1"
PS C:\>$IPconfig = New-AzNetworkInterfaceIpConfig -Name "IPConfig1" -PrivateIpAddressVersion IPv4 -PrivateIpAddress "10.0.1.10" -SubnetId $Subnet.Subnets[0].Id
PS C:\> New-AzNetworkInterface -Name "NetworkInterface1" -ResourceGroupName "ResourceGroup1" -Location "centralus" -IpConfiguration $IPconfig
```

This example creates a new network interface using an IP configuration object. The IP configuration
object specifies a static private IPv4 address.
The first command creates a network interface IP configuration named IPConfig1 and stores the
The first command retrieves an existing specified virtual network used to assign the subnet in the second command.
The second command creates a network interface IP configuration named IPConfig1 and stores the
configuration in the variable named $IPconfig.
The second command creates a network interface named NetworkInterface1 that uses the network
The third command creates a network interface named NetworkInterface1 that uses the network
interface IP configuration stored in the variable named $IPconfig.

## PARAMETERS
Expand Down