< Back

Set-AzureRmLoadBalancer

Tue Jan 29, 2019 9:58 pm

NAME Set-AzureRmLoadBalancer



SYNOPSIS

Sets the goal state for a load balancer.





SYNTAX

Set-AzureRmLoadBalancer [-AsJob] [-DefaultProfile <IAzureContextContainer>] -LoadBalancer <PSLoadBalancer> [<CommonParameters>]





DESCRIPTION

The Set-AzureRmLoadBalancer cmdlet sets the goal state for an Azure load balancer.





PARAMETERS

-AsJob [<SwitchParameter>]

Run cmdlet in the background



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LoadBalancer <PSLoadBalancer>

Specifies a load balancer. This cmdlet sets the goal state for the load balancer that this parameter specifies.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

PSLoadBalancer

Parameter 'LoadBalancer' accepts value of type 'PSLoadBalancer' from the pipeline





OUTPUTS

Microsoft.Azure.Commands.Network.Models.PSLoadBalancer







NOTES









Example 1: Modify a load balancer



PS C:\\>$slb = Get-AzureRmLoadBalancer -Name "NRPLB" -ResourceGroupName "NRP-RG"

PS C:\\> $slb | Add-AzureRmLoadBalancerInboundNatRuleConfig -Name "NewRule" -FrontendIpConfiguration $slb.FrontendIpConfigurations[0] -FrontendPort

81 -BackendPort 8181 -Protocol "TCP"

PS C:\\> $slb | Set-AzureRmLoadBalancer



The first command gets the load balancer named NRPLB, and then stores it in the $slb variable.



The second command uses the pipeline operator to pass the load balancer in $slb to Add-AzureRmLoadBalancerInboundNatRuleConfig, which adds an

inbound NAT rule named NewRule.



The third command passes the load balancer to Set-AzureRmLoadBalancer , which updates the load balancer configuration and saves it.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... adbalancer

Get-AzureRmLoadBalancer

New-AzureRmLoadBalancer

Remove-AzureRmLoadBalancer