New-AzureRmVirtualNetworkGatewayIpConfig

Creates an IP Configuration for a Virtual Network Gateway

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmVirtualNetworkGatewayIpConfig
   -Name <String>
   [-PrivateIpAddress <String>]
   [-SubnetId <String>]
   [-PublicIpAddressId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzureRmVirtualNetworkGatewayIpConfig
   -Name <String>
   [-PrivateIpAddress <String>]
   [-Subnet <PSSubnet>]
   [-PublicIpAddress <PSPublicIpAddress>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureRmVirtualNetworkGatewayIpConfig cmdlet creates a configuration assigned to a Virtual Network Gateway with a (previously created) Public IP Address based on Subnet ID.

Examples

1: Create an IP Configuration for a Virtual Network Gateway

$gwIpConfig = New-AzureRmVirtualNetworkGatewayIpConfig -Name myGWIpConfig -SubnetId $myGWsubnet.Id -PublicIpAddressId $myGWpip.Id

Configures a Virtual Network Gateway with a Public IP Address. The variable $myGWsubnet is obtained using the Get-AzureRmVirtualNetworkSubnetConfig cmdlet on the "GatewaySubnet" within the Virtual Network you intend to create a Virtual Network Gateway. The variable $myGWpip is obtained using the New-AzureRmPublicIpAddress cmdlet.

Parameters

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PrivateIpAddress

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PublicIpAddress

Type:PSPublicIpAddress
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PublicIpAddressId

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Subnet

Type:PSSubnet
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubnetId

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSVirtualNetworkGatewayIpConfiguration