Created
August 5, 2014 02:01
-
-
Save andreaswasita/9d14a34833422934f351 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
cls | |
# Define variables | |
$AGNodes = "azsedb001","azsedb002" # SQL AAG VMs in SEVNET | |
$ServiceName = "azsedb" # SQL VMs Cloud Service in SEVNET | |
$EndpointName = "SQLAAG" # name of the endpoint | |
$EndpointPort = "1433" # public port to use for the endpoint | |
# Configure a load balanced endpoint for each node in $AGNodes, with direct server return enabled | |
ForEach ($node in $AGNodes) | |
{ | |
Get-AzureVM -ServiceName $ServiceName -Name $node | Add-AzureEndpoint -Name $EndpointName -Protocol "TCP" -PublicPort $EndpointPort -LocalPort $EndpointPort -LBSetName "$EndpointName-LB" -ProbePort 59999 -ProbeProtocol "TCP" -DirectServerReturn $true | Update-AzureVM | |
} | |
# Define variables | |
$AGNodes = "azusdb001" # SQL AAG VMs in USVNET | |
$ServiceName = "azusdb" # SQL VMs Cloud Service in USVNET | |
# Configure a load balanced endpoint for each node in $AGNodes, with direct server return enabled | |
ForEach ($node in $AGNodes) | |
{ | |
Get-AzureVM -ServiceName $ServiceName -Name $node | Add-AzureEndpoint -Name $EndpointName -Protocol "TCP" -PublicPort $EndpointPort -LocalPort $EndpointPort -LBSetName "$EndpointName-LB" -ProbePort 59999 -ProbeProtocol "TCP" -DirectServerReturn $true | Update-AzureVM | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment