Skip to content

Instantly share code, notes, and snippets.

@RMcD
Last active August 29, 2015 14:01
Show Gist options
  • Save RMcD/24fac061e33422f26a3d to your computer and use it in GitHub Desktop.
Save RMcD/24fac061e33422f26a3d to your computer and use it in GitHub Desktop.
AlwaysOn Configuration for Azure Internal Load Balencers
$cloudService="corp-ods-db"
$ilb="corp-ods-lb"
$subnet="AlwaysOn-Static"
$IP="10.10.4.7"
Add-AzureInternalLoadBalancer -ServiceName $cloudService -InternalLoadBalancerName $ilb –SubnetName $subnet –StaticVNetIPAddress $IP
$vmNames=@("corp-ods-db1","corp-ods-db2")
$endPointName="SQLServer"
$prot="tcp"
$localPort=1433
$publicPort=1433
$probePort=59999
$probeProt="TCP"
foreach ($vmName in $vmNames) {
Get-AzureVM –ServiceName $cloudService –Name $vmName | Add-AzureEndpoint -Name $endPointName -LBSetName "$endPointName-LB" -Protocol $prot -LocalPort $localPort -PublicPort $publicPort –ProbePort $probePort -ProbeProtocol $probeProt -DirectServerReturn $true -InternalLoadBalancerName $ilb | Update-AzureVM
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment