Editar

Partilhar via


Set-AzLoadBalancerBackendAddressPool

Updates the backend pool on a loadbalancer

Syntax

Set-AzLoadBalancerBackendAddressPool
   -ResourceGroupName <String>
   -LoadBalancerName <String>
   -Name <String>
   -LoadBalancerBackendAddress <PSLoadBalancerBackendAddress[]>
   [-TunnelInterface <PSTunnelInterface[]>]
   [-Force]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzLoadBalancerBackendAddressPool
   -Name <String>
   -LoadBalancer <PSLoadBalancer>
   -LoadBalancerBackendAddress <PSLoadBalancerBackendAddress[]>
   [-TunnelInterface <PSTunnelInterface[]>]
   [-Force]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzLoadBalancerBackendAddressPool
   -InputObject <PSBackendAddressPool>
   [-TunnelInterface <PSTunnelInterface[]>]
   [-Force]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzLoadBalancerBackendAddressPool
   -LoadBalancerBackendAddress <PSLoadBalancerBackendAddress[]>
   -ResourceId <String>
   [-TunnelInterface <PSTunnelInterface[]>]
   [-Force]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Updates the backend pool on a loadbalancer

Examples

Example 1

# Set by name and modified input object
$virtualNetwork = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $resourceGroup
$lb = Get-AzLoadBalancer -ResourceGroupName $resourceGroup -Name $loadBalancerName
$ip1 = New-AzLoadBalancerBackendAddressConfig -IpAddress "10.0.0.5" -Name "TestVNetRef" -VirtualNetworkId $virtualNetwork.Id
$ip2 = New-AzLoadBalancerBackendAddressConfig -IpAddress "10.0.0.6" -Name "TestVNetRef2" -VirtualNetworkId $virtualNetwork.Id
$ip3 = New-AzLoadBalancerBackendAddressConfig -IpAddress "10.0.0.7" -Name "TestVNetRef3" -VirtualNetworkId $virtualNetwork.id
$tunnelInterface1 = New-AzLoadBalancerBackendAddressPoolTunnelInterfaceConfig -Protocol "Vxlan" -Type "Internal" -Port 2000 -Identifier 800
$tunnelInterface2 = New-AzLoadBalancerBackendAddressPoolTunnelInterfaceConfig -Protocol "Vxlan" -Type "External" -Port 2001 -Identifier 801
New-AzLoadBalancerBackendAddressPool -ResourceGroupName $resourceGroup -LoadBalancerName $loadBalancerName -Name $backendPool3 -TunnelInterface $tunnelInterface1, $tunnelInterface2
$ips = @($ip1, $ip2)
$b2 = Get-AzLoadBalancerBackendAddressPool -ResourceGroupName $resourceGroup -LoadBalancerName $loadBalancerName -Name $backendPool1
$b2.LoadBalancerBackendAddresses.Add($ip3)

Set-AzLoadBalancerBackendAddressPool -InputObject $b2

Example 2

# Set by specific backend from piped loadbalancer and set two IP's
$lb | Set-AzLoadBalancerBackendAddressPool -LoadBalancerBackendAddress $ips -Name $backendPool1

Example 3

# Set by ResourceId
Set-AzLoadBalancerBackendAddressPool -ResourceId $b2.Id -LoadBalancerBackendAddress $b2.LoadBalancerBackendAddresses

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

-Force

Do not ask for confirmation.

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

-InputObject

The backend address pool to set

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

-LoadBalancer

The load balancer resource.

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

-LoadBalancerBackendAddress

The backend addresses.

Type:PSLoadBalancerBackendAddress[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-LoadBalancerName

The name of the load balancer.

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

-Name

The name of the backend pool.

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

-PassThru

{{ Fill PassThru Description }}

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

-ResourceGroupName

The resource group name of the load balancer.

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

-ResourceId

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

-TunnelInterface

Gateway Load Balancer provider configurations.

Type:PSTunnelInterface[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSLoadBalancer

String

Outputs

PSBackendAddressPool