Edit

New-AzVMIpConfig

Creates an IP configuration for an implicit virtual machine network interface.

Syntax

Default (Default)

New-AzVMIpConfig
    [-Name <String>]
    [-SubnetId <String>]
    [-Primary]
    [-PrivateIPAddressVersion <String>]
    [-PublicIPAddressConfigurationName <String>]
    [-PublicIPAddressConfigurationIdleTimeoutInMinutes <Int32>]
    [-DnsSetting <String>]
    [-IpTag <VirtualMachineIpTag[]>]
    [-PublicIPPrefix <String>]
    [-PublicIPAddressVersion <String>]
    [-PublicIPAllocationMethod <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzVMIpConfig cmdlet creates an IP configuration for an implicit virtual machine (VM) network interface. When public IP parameters or IpTag objects are supplied, the cmdlet initializes a nested public IP address configuration. Any supplied IP tag objects are copied into that public IP configuration.

Examples

Example 1: Create an IP configuration with a first-party service IP tag

$serviceTagResourceId = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/firstPartyServiceTags/myServiceTag'
$subnetId = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet'
$ipTag = New-AzVMIpTagConfig -IpTagType 'FirstPartyUsage' -FirstPartyServiceTagId $serviceTagResourceId
$ipConfig = New-AzVMIpConfig -Name 'ipConfig' -SubnetId $subnetId -PublicIPAddressConfigurationName 'publicIpConfig' -IpTag $ipTag

This example creates an implicit network interface IP configuration with a nested public IP configuration and first-party service IP tag.

Example 2: Configure implicit private and public IP address properties

$prefixId = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPPrefixes/myPrefix'
$ipConfig = New-AzVMIpConfig -Name 'ipConfig' -Primary -PrivateIPAddressVersion 'IPv4' `
    -PublicIPAddressConfigurationName 'publicIpConfig' -PublicIPAddressConfigurationIdleTimeoutInMinutes 10 `
    -DnsSetting 'my-vm' -PublicIPPrefix $prefixId -PublicIPAddressVersion 'IPv4' `
    -PublicIPAllocationMethod 'Static'

This example configures private IP version and the DNS label, prefix, version, allocation method, and idle timeout for an implicit public IP address.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DnsSetting

Specifies the domain name label for the implicit public IP address.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PublicIPAddressDomainNameLabel

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IpTag

Specifies IP tags to associate with the implicit public IP address.

Parameter properties

Type:

VirtualMachineIpTag[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the IP configuration name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Primary

Indicates that this is the primary IP configuration.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PrivateIPAddressVersion

Specifies the private IP address version. Accepted values are IPv4 and IPv6.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PublicIPAddressConfigurationIdleTimeoutInMinutes

Specifies the idle timeout, in minutes, for the implicit public IP address.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PublicIPAddressIdleTimeoutInMinutes

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PublicIPAddressConfigurationName

Specifies the name of the nested implicit public IP address configuration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PublicIPAddressName

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PublicIPAddressVersion

Specifies the public IP address version. Accepted values are IPv4 and IPv6.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PublicIPAllocationMethod

Specifies the allocation method for the implicit public IP address. Accepted values are Dynamic and Static.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PublicIPPrefix

Specifies the resource ID of the public IP prefix from which the implicit public IP address is allocated.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SubnetId

Specifies the resource ID of the subnet for the IP configuration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

VirtualMachineIpTag

Outputs

VirtualMachineNetworkInterfaceIPConfiguration