Skip to content

Commit b8a444a

Browse files
dingmeng-xueKawilki-Misra-felv-shhattMikhailTryakhov
authored
Add LoadBalancer features (#13499)
* Updates project with generated nuget package from july release .net sdk and added new global load balancing properties to associated loadbalancer and ipaddress commands * Updated Network changelog.md * Added tests, new cross region loadbalancer backend address config command, global tier to ip prefix, and ip prefix parameter to create loadbalancer frontend ip config command * updated changelog * removed frontend paramter from original backendaddress config command * removed new cross region loadbalancer backend address config command, added loadbalancer frontend ip config paramater to existing new backend address config command and updated help files for the new paramter and ip prefix paramter on loadbalancer frontend ip config command * Added ipprefix(id) parameters to set and add commands for loadbalancer frontend ip config * addressing comments * removing white spaces * reverted powershell to pwsh * updated backend address model with new property * ran automation for help files * fixed changelog syntax * add pass by value option to new, set, and add commands for frontend ip config and added test example * Updated ApiVersion from 2020-05-01 to 2020-07-01 (#13357) Updated ApiVersion from 2020-05-01 to 2020-07-01 * Added officially published SDK (#13409) * updating nuget package * updating nuget package * updating CreateSubresourcesOnEmptyLoadBalancer UT to comply with changes in new network SDK * Add TranslatedFqdn option for Azure Firewall Policy NAT Rule (#13238) * Add TranslatedFqdn option for Azure Firewall Policy NAT Rule * Fixing LB test * Fixed more LB tests * deleted local nugets * removed 20.2.0 nuget package and modules.zip * adding examples for new parameters * update azvirtualrouter (#13455) * removing space * Add Get-AzVirtualRouterPeerAdvertisedRoute and Get-AzVirtualRouterPeerLearnedRoute with warning messageVr peer (#13462) * Add Get-AzVirtualRouterPeerAdvertisedRoute and Get-AzVirtualRouterPeerLearnedRoute with warning message * Delete Authentication - Backup.csproj * Update ChangeLog.md * Update ChangeLog.md * Update ChangeLog.md * Update ChangeLog.md Co-authored-by: Yabo Hu <[email protected]> * Adding allocation method fix to Test-PublicIpAddressCRUD-StandardSkuGlobalTier * copied recorded sessions for new tests into project session records folder * updating TestSetLoadBalancerCRUDPublicBasicSku session record * updated session record for TestLoadBalancerBackendPoolCreate * Updated session record for TestGlobalLoadBalancerBackendPoolCreate Co-authored-by: Kayden <[email protected]> Co-authored-by: Yeming Liu <[email protected]> Co-authored-by: Ranjani Hatti <[email protected]> Co-authored-by: Mikhail <[email protected]> Co-authored-by: tejasshah7 <[email protected]> Co-authored-by: litchiyangMSFT <[email protected]> Co-authored-by: Yabo Hu <[email protected]>
1 parent 41632f4 commit b8a444a

File tree

56 files changed

+18057
-6492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+18057
-6492
lines changed

src/Network/Network.Test/ScenarioTests/LoadBalancerBackendPoolTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ public void TestLoadBalancerBackendPoolCreate()
4141
TestRunner.RunTestScript("Test-LoadBalancerBackendPoolCreate");
4242
}
4343

44+
[Fact]
45+
[Trait(Category.AcceptanceType, Category.CheckIn)]
46+
[Trait(Category.Owner, NrpTeamAlias.slbdev)]
47+
public void TestGlobalLoadBalancerBackendPoolCreate()
48+
{
49+
TestRunner.RunTestScript("Test-GlobalLoadBalancerBackendPoolCreate");
50+
}
51+
4452
[Fact]
4553
[Trait(Category.AcceptanceType, Category.CheckIn)]
4654
[Trait(Category.Owner, NrpTeamAlias.slbdev)]

src/Network/Network.Test/ScenarioTests/LoadBalancerBackendPoolTests.ps1

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ function Test-LoadBalancerBackendPoolCRUD
8484
}
8585
}
8686

87-
8887
<#
8988
.SYNOPSIS
9089
Tests
@@ -97,7 +96,6 @@ function Test-LoadBalancerBackendPoolCreate
9796
$vnetName = Get-ResourceName
9897
$subnetName = Get-ResourceName
9998
$publicIpName = Get-ResourceName
100-
$domainNameLabel = Get-ResourceName
10199
$lbName = Get-ResourceName
102100
$frontendName = Get-ResourceName
103101
$backendAddressPoolName = Get-ResourceName
@@ -120,7 +118,7 @@ function Test-LoadBalancerBackendPoolCreate
120118

121119
try
122120
{
123-
# Create the resource group
121+
# Create the resource group
124122
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval"}
125123

126124
# Create the Virtual Network
@@ -135,7 +133,7 @@ function Test-LoadBalancerBackendPoolCreate
135133
$ip3 = New-AzLoadBalancerBackendAddressConfig -IpAddress $testIpAddress3 -Name $backendAddressConfigName3 -VirtualNetworkId $vnet.Id
136134

137135
$ips = @($ip1, $ip2)
138-
136+
139137
## create by passing loadbalancer without Ips
140138
$create1 = $lb | New-AzLoadBalancerBackendAddressPool -Name $backendPool1
141139

@@ -164,6 +162,74 @@ function Test-LoadBalancerBackendPoolCreate
164162
}
165163
}
166164

165+
<#
166+
.SYNOPSIS
167+
Tests
168+
#>
169+
function Test-GlobalLoadBalancerBackendPoolCreate
170+
{
171+
172+
# Setup
173+
$rgname = Get-ResourceGroupName
174+
$rglocation = Get-ProviderLocation ResourceManagement
175+
176+
$vnetName = Get-ResourceName
177+
$location = Get-ProviderLocation "Microsoft.Network/loadBalancers"
178+
179+
$publicIpName = Get-ResourceName
180+
$domainNameLabel = Get-ResourceName
181+
182+
$frontendName = Get-ResourceName
183+
$backendAddressPoolName = Get-ResourceName
184+
$probeName = Get-ResourceName
185+
$inboundNatRuleName = Get-ResourceName
186+
$lbruleName = Get-ResourceName
187+
$lbName = Get-ResourceName
188+
189+
$globalrgname = Get-ResourceName
190+
$globalvnet = Get-ResourceName
191+
$globallbname = Get-ResourceName
192+
$globalsubnetname = Get-ResourceName
193+
194+
$globalbackendPool = Get-ResourceName
195+
$globalbackendAddressConfigName = Get-ResourceName
196+
197+
try
198+
{
199+
# Create the regional resource group
200+
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval"}
201+
202+
# Create the publicip
203+
$publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Static -DomainNameLabel $domainNameLabel -SKU Standard
204+
205+
# Create regional loadbalancer
206+
$frontend = New-AzLoadBalancerFrontendIpConfig -Name $frontendName -PublicIpAddress $publicip
207+
$backendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $backendAddressPoolName
208+
$probe = New-AzLoadBalancerProbeConfig -Name $probeName -RequestPath healthcheck.aspx -Protocol http -Port 80 -IntervalInSeconds 15 -ProbeCount 2
209+
$inboundNatRule = New-AzLoadBalancerInboundNatRuleConfig -Name $inboundNatRuleName -FrontendIPConfiguration $frontend -Protocol Tcp -FrontendPort 3389 -BackendPort 3389 -IdleTimeoutInMinutes 15 -EnableFloatingIP
210+
$lbrule = New-AzLoadBalancerRuleConfig -Name $lbruleName -FrontendIPConfiguration $frontend -BackendAddressPool $backendAddressPool -Probe $probe -Protocol Tcp -FrontendPort 80 -BackendPort 80 -IdleTimeoutInMinutes 15 -EnableFloatingIP -LoadDistribution SourceIP
211+
$job = New-AzLoadBalancer -Name $lbName -ResourceGroupName $rgname -Location $location -FrontendIpConfiguration $frontend -BackendAddressPool $backendAddressPool -Probe $probe -InboundNatRule $inboundNatRule -LoadBalancingRule $lbrule -AsJob -SKU Standard
212+
$job | Wait-Job
213+
$actualLb = $job | Receive-Job
214+
215+
# Create the global resource group
216+
$resourceGroup = New-AzResourceGroup -Name $globalrgname -Location $rglocation -Tags @{ testtag = "testval"}
217+
218+
# Create global loadbalancer
219+
$glb = New-AzLoadBalancer -Name $globallbname -ResourceGroupName $globalrgname -Location $location -SKU Standard -Tier Global
220+
221+
$regionalbackendaddress = New-AzLoadBalancerBackendAddressConfig -LoadBalancerFrontendIPConfigurationId $frontend.Id -Name $globalbackendAddressConfigName
222+
$create = $glb | New-AzLoadBalancerBackendAddressPool -Name $globalbackendPool -LoadBalancerBackendAddress $regionalbackendaddress
223+
224+
Assert-NotNull $create
225+
Assert-True { @($create.LoadBalancerBackendAddresses).Count -eq 1}
226+
}
227+
finally {
228+
# Cleanup
229+
Clean-ResourceGroup $rgname
230+
}
231+
}
232+
167233
<#
168234
.SYNOPSIS
169235
Tests Remove-AzLoadBalancerBackendAddressPool

src/Network/Network.Test/ScenarioTests/LoadBalancerTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,22 @@ public void TestSetLoadBalancerCRUDPublicStandardSku()
193193
TestRunner.RunTestScript("Test-LoadBalancerCRUD-PublicStandardSku");
194194
}
195195

196+
[Fact]
197+
[Trait(Category.AcceptanceType, Category.CheckIn)]
198+
[Trait(Category.Owner, NrpTeamAlias.slbdev)]
199+
public void TestSetLoadBalancerCRUDPublicStandardSkuIpPrefix()
200+
{
201+
TestRunner.RunTestScript("Test-LoadBalancerCRUD-PublicStandardSkuIpPrefix");
202+
}
203+
204+
[Fact]
205+
[Trait(Category.AcceptanceType, Category.CheckIn)]
206+
[Trait(Category.Owner, NrpTeamAlias.slbdev)]
207+
public void TestSetLoadBalancerCRUDPublicStandardSkuGlobalTier()
208+
{
209+
TestRunner.RunTestScript("Test-LoadBalancerCRUD-PublicStandardSkuGlobalTier");
210+
}
211+
196212
[Fact]
197213
[Trait(Category.AcceptanceType, Category.CheckIn)]
198214
[Trait(Category.Owner, NrpTeamAlias.slbdev)]

0 commit comments

Comments
 (0)