Created
September 15, 2019 20:18
-
-
Save staslebedenko/b50a362803524d17f4cdbd70f74bddd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Login-AzureRmAccount | |
Select-AzureRmSubscription -TenantId 30593919-4e6a | |
$probename = "HttpsPassProbe" | |
$rulename="AppPortLBRuleFor8427" | |
$groupname="bootcamp2019-fabric-cluster-group" | |
$frontPort=8427 | |
$backPort=8427 | |
$resource = Get-AzureRmResource | Where {$_.ResourceGroupName –eq $groupname -and $_.ResourceType -eq "Microsoft.Network/loadBalancers"} | |
$loadbalancer = Get-AzureRmLoadBalancer -Name $resource.Name -ResourceGroupName $groupname | |
$loadbalancer | Add-AzureRmLoadBalancerProbeConfig -Name $probename -Protocol Tcp -Port $backPort -IntervalInSeconds 15 -ProbeCount 2 | |
$probe = Get-AzureRmLoadBalancerProbeConfig -Name $probename -LoadBalancer $loadbalancer | |
$loadbalancer | Add-AzureRmLoadBalancerRuleConfig -Name $rulename -BackendAddressPool $loadbalancer.BackendAddressPools[0] -FrontendIpConfiguration $loadbalancer.FrontendIpConfigurations[0] -Probe $probe -Protocol Tcp -FrontendPort $frontPort -BackendPort $backPort | |
$loadbalancer | Set-AzureRmLoadBalancer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment