Edit

Share via


Set-AzLoadBalancerBackendAddressPool

Updates the backend pool on a loadbalancer

Syntax

SetByNameParameterSet (Default)

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

SetByParentObjectParameterSet

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

SetByInputObjectParameterSet

Set-AzLoadBalancerBackendAddressPool
    -InputObject <PSBackendAddressPool>
    [-TunnelInterface <PSTunnelInterface[]>]
    [-Force]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetByResourceIdParameterSet

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.

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

-Force

Do not ask for confirmation.

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

-InputObject

The backend address pool to set

Parameter properties

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

Parameter sets

SetByInputObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-LoadBalancer

The load balancer resource.

Parameter properties

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

Parameter sets

SetByParentObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-LoadBalancerBackendAddress

The backend addresses.

Parameter properties

Type:

PSLoadBalancerBackendAddress[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetByParentObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetByResourceIdParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LoadBalancerName

The name of the load balancer.

Parameter properties

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

Parameter sets

SetByNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the backend pool.

Parameter properties

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

Parameter sets

SetByNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetByParentObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

{{ Fill PassThru Description }}

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

-ResourceGroupName

The resource group name of the load balancer.

Parameter properties

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

Parameter sets

SetByNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceId

Updates the backend pool on a loadbalancer

Parameter properties

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

Parameter sets

SetByResourceIdParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TunnelInterface

Gateway Load Balancer provider configurations.

Parameter properties

Type:

PSTunnelInterface[]

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

-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

PSLoadBalancer

String

Outputs

PSBackendAddressPool