編輯

共用方式為


Add-AzApplicationGatewayIPConfiguration

Adds an IP configuration to an application gateway.

Syntax

Add-AzApplicationGatewayIPConfiguration
   -ApplicationGateway <PSApplicationGateway>
   -Name <String>
   [-SubnetId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Add-AzApplicationGatewayIPConfiguration
   -ApplicationGateway <PSApplicationGateway>
   -Name <String>
   [-Subnet <PSSubnet>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Add-AzApplicationGatewayIPConfiguration cmdlet adds an IP configuration to an application gateway. IP configurations contain the subnet in which the application gateway is deployed.

Examples

Example 1: Add an virtual network configuration to an application gateway

$Vnet = Get-AzVirtualNetwork -Name "Vnet01" -ResourceGroupName "ResourceGroup01"
$Subnet = Get-AzVirtualNetworkSubnetConfig -Name "Subnet01" -VirtualNetwork $Vnet 
$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$AppGw = Add-AzApplicationGatewayIPConfiguration -ApplicationGateway $AppGw -Name "Appgwsubnet01" -Subnet $Subnet

The first command gets a virtual network. The second command gets a subnet using the previously created virtual network. The third command gets the application gateway and stores it in the $AppGw variable. The fourth command adds the IP configuration to the application gateway stored in $AppGw.

Parameters

-ApplicationGateway

Specifies the application gateway to which this cmdlet adds an IP configuration.

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

-DefaultProfile

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

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

-Name

Specifies the name of the IP configuration to add.

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

-Subnet

Specifies a subnet. This is the subnet in which the application gateway is deployed.

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

-SubnetId

Specifies a subnet ID. This is the subnet in which the application gateway is deployed.

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

Inputs

PSApplicationGateway

Outputs

PSApplicationGateway