Skip to content

Commit af1ac14

Browse files
aneeshakella-microsoftazure-powershell-botNickcandyisra-felwyunchi-ms
authored
Adding Autoscaling Capabilities to Virtual Network Gateway (#22637)
* Bump up version for KeyVault (#22511) * Merge remote-tracking branch 'upstream/main' into lnx/azurecore (#22349) Co-authored-by: Yeming Liu <[email protected]> * Exclude the api-version in typename when checking the breaking change of cmdlet output (#22495) * Exclude the api-version in typename when checking the breaking change of cmdlet output * Rename the function * fix Get-AzVmRunCommand bug (#22460) * fix bug * changelog --------- Co-authored-by: Theodore Chang <[email protected]> * Add permission for pr-label github actions (#22481) * Add permission for pr-label github actions * Add permission for pr-label github actions * Add permission for pr-label github actions * Add permission for pr-label github actions * Update Remove-AzApiManagementApiFromGateway.md (#22505) Added the example of removing an API from a managed gateway. Users are not able to achieve it by following the first example and raising questions using support tickets. * Migrate StackHCI from generation to main (#22541) * Move StackHCI to main * udpate changelog --------- Co-authored-by: YanaXu <[email protected]> * [KeyVault] Support MHSM Settings (#22525) * wip * add update-azkeyvaultsetting and help docs * add example for settings * add change log * add live test * fix * fix * Migrate ContainerInstance from generation to main (#22537) * Move ContainerInstance to main * Create containerGroups-containers.json * Create containerGroups.json --------- Co-authored-by: Beisi Zhou <[email protected]> * Updated ChangeLog.md for Az.ContainerInstance (#22550) * Updated ChangeLog.md for Az.ContainerInstance * Update src/ContainerInstance/ChangeLog.md --------- Co-authored-by: Beisi Zhou <[email protected]> * [Synapse] Update artifact to 1.0.0-preview.18 (#22452) * update artifact to 18 * fix change log error * workaround the assembly loading issue (#22551) * [Compute] update sdk package reference for Compute (#22459) * update SDK reference * resolve breaking change * update package reference * breaking change mitigation * breaking change suppression * re-record ssh test with latest compute API call --------- Co-authored-by: Theodore Chang <[email protected]> * Bump up version for StackHCI (#22543) * Compute migration to track 1 deprecation (#21949) * add compute.sdk project reference * add sdk folder * address comments * update commit version to inputs * rename Compute.Sdk folder to Compute.Management.Sdk * resolve xmls, change compute.sdk reference to compute.management.sdk * remove SDK reference. generate track 1 with latest DiskRP version * Update src/Compute/Compute.Management.Sdk/README.md Co-authored-by: Vincent Dai <[email protected]> * fix autorest cmd * update autorest gen * Update Compute.Management.Sdk.csproj * generated with latest swagger versions. 2023-04-02 diskRP 2023-07-01 CRP * update assembly version of sdk --------- Co-authored-by: Theodore Chang <[email protected]> Co-authored-by: Vincent Dai <[email protected]> * [KeyVault] Added security domain properties into PSManagedHsm (#22540) * Refresh track 1 SDK * Added security domain properties into the output of New/Update/Get-AzKeyVaultManagedHsm (PSManagedHsm) * Refresh example * hibernate parameter for Stop-AzVmss (#22560) Co-authored-by: Theodore Chang <[email protected]> * Update PrLabeled.ps1 (#22553) * Adding XenonMV3 Support (#22530) * adding PremiumMV3 to Xenon list * updating changelog --------- Co-authored-by: Nalin Gaddis <[email protected]> * Upgraded vulnerable DLLs after upgrading PowerShell SDK (#22566) * Update New-AzVirtualNetworkSubnetConfig.md (#22561) `New-AzVirtualSubnetConfig` does not exists but `New-AzVirtualNetworkSubnetConfig` does. * Generate aks sdk with autorest.powershell (#22501) * Generate aks sdk with autorest.powershell * Suppress breaking changes caused by character case change * [KeyVault] Add live tests for MHSM Settings (#22570) * Add live tests for MHSM Settings * enable all test cases * [Config] add config to disable write error to file system (#22529) * disable error records persistence * add keys * upgrade common version * polish help message for 'DisableErrorRecordsPersistence' * Update src/Accounts/Authentication/Properties/Resources.resx Co-authored-by: Yeming Liu <[email protected]> * remove debug parameters for get/clear/update config * update environment variable name to AzPSDisableErrorRecordsPersistence --------- Co-authored-by: Yeming Liu <[email protected]> * Updated email notification to support multi-recipients (#22577) * Use autorest.powershell to generate AlertsManagement SDK to replace the track 1 SDK (#22579) * [Storage] Support encryption context property when creating a datalakegen2 item (#22563) * encryption context * Add changelog * update test dependency and help file * Add an example for encryption context * Migrate StackHCI from generation to main (#22588) * Move StackHCI to main * update changelog --------- Co-authored-by: YanaXu <[email protected]> * Support deployment stack object as input parameter for Save-Az*DeploymentStack and Remove-Az*DeploymentStack cmdlets (#22519) * implemented stack object parameter sets for save and remove cmdlets * adjust tests and session records * adjusted changelog to reflect changes * adjust testing formatting * updating help docs * update cmdlets and help docs for renamed parameter * update sessions record tests * Migrate DataMigration from generation to main (#22574) * Move DataMigration to main * update ChangeLog --------- Co-authored-by: YanaXu <[email protected]> * change breaking change info (#22571) * Fixed type conversion issue when sending email in live test (#22596) * Skip Accounts when run static analysis check in generation ci (#22597) * [HDInsight] Add warning message for break changes which plan to release in Nov. (#22578) * Update Azure.Core from 1.31.0 to 1.33.0 * replace models * Revert "replace models" This reverts commit d1a1de3. * add Warning message 1 * Update Azure.Core version to 1.34 * revert added package. * Update change log * Update changelog * move changelog to Upcoming release --------- Co-authored-by: v-yuchenli <[email protected]> * Update code-oob.yml for Azure Pipelines (#22591) * Update code-oob.yml for Azure Pipelines * Update code-oob.yml for Azure Pipelines * Update code-oob.yml for Azure Pipelines * Update code-oob.yml for Azure Pipelines * Update code-oob.yml for Azure Pipelines * [KeyVault] Formatted the table view of outputs (#22580) * Formatted the table view of *-AzKeyVault, *-AzKeyVaultKey and *-AzKeyVaultSecret * format cert * reorg folder constructure * Update src/KeyVault/KeyVault.Test/UnitTests/SetKeyVaultSecretTests.cs * Update src/KeyVault/KeyVault.Test/UnitTests/RemoveKeyVaultSecretTests.cs * Update src/KeyVault/KeyVault/KeyVault.csproj * Update Maintenance ChangeLog.md (#22602) * Update ChangeLog.md * Update ChangeLog.md * Update ChangeLog.md * Skip Accounts when run static analysis check in generation ci (#22603) * Skip Accounts when run static analysis check in generation ci * Skip Accounts when run static analysis check in generation ci * Skip Accounts when run static analysis check in generation ci * Add SecurityType of Standard to VM and VMSS cmdlets for Trusted Launch, includes breaking changes (#22534) * initial dev * successful test 1 * vmss test and rest of dev * vmss with config test * vm with config test * tests fixed maybe 1 fails * static analysis * remove vmss validation * null check * changelog and help doc * constant values * clean * valids and clean * Update BreakingChangeIssues.csv * remove breaking * Update BreakingChangeIssues.csv * Sign old modules (#22609) * Update ChangeLog.md * Update ChangeLog.md * Update ChangeLog.md * Update ChangeLog.md * Update ChangeLog.md * Migrate SqlVirtualMachine from generation to main (#22608) * Move SqlVirtualMachine to main * update Changelog --------- Co-authored-by: YanaXu <[email protected]> * Migrate EventHub from generation to main (#22610) * Move EventHub to main * update ChangeLog --------- Co-authored-by: YanaXu <[email protected]> * Refill Credentials from AzKeyStore When Save AzContext (#22440) * Refill Credentials from AzKeyStore When Save AzContext fix #22355 * Address review comments * Address review comments * CosmosDB - New Restore Parameter (#22585) * restore new param public network access * minor fixes * test change * stable changes 1 * md param def changed * reverting test changes for build * restore ts * test and test recording * Migrate KeyVault from generation to main (#22621) * Move KeyVault to main * Update ChangeLog.md --------- Co-authored-by: Beisi Zhou <[email protected]> * FabricBot: Onboarding to GitOps.ResourceManagement because of FabricBot decommissioning (#22343) * Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement as FabricBot replacement Owners of the FabricBot configuration should have received email notification. The same information contained in the email is published internally at: https://aka.ms/gim/fabricbot. Details on the replacement service and the syntax of the new yaml configuration file is available publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html Please review and merge this PR to complete the process of onboarding to the new service. * Deleting fabricbot.json * Update resourceManagement.yml --------- Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com> Co-authored-by: Vincent Dai <[email protected]> * [KeyVault] Update TestSetting.ps1 to run on one platform and latest powershell (#22618) * Update TestSetting.ps1 * Update KeyVault.sln * first set of changes * created initial powershell for ergwscale * edited changelog * update warning message (#22619) * Fix to only include non-empty ExtendedLocation (#22630) * Fix to only include non-empty ExtendedLocation * Updated ChangeLog.md * Remove PS 7.0 from smoke test (#22569) * Alias Set-AzConfig (#22629) * updated files due to failing test * formatting changes * formatting changes * Revert "formatting changes" This reverts commit d8900c5. * Revert " fixed merge issues" This reverts commit bc4af78, reversing changes made to d8900c5. * finished changes * formatting * formatting * formatting * edited ChangeLog * added empty line * added empty line between 6.1.1 and 6.1.0 --------- Co-authored-by: Azure PowerShell <[email protected]> Co-authored-by: NanxiangLiu <[email protected]> Co-authored-by: Yeming Liu <[email protected]> Co-authored-by: Yunchi Wang <[email protected]> Co-authored-by: Theodore Chang <[email protected]> Co-authored-by: Theodore Chang <[email protected]> Co-authored-by: Saurav Raghuvanshi <[email protected]> Co-authored-by: YanaXu <[email protected]> Co-authored-by: Beisi Zhou <[email protected]> Co-authored-by: Andrey Goran <[email protected]> Co-authored-by: kevinzz6 <[email protected]> Co-authored-by: Vincent Dai <[email protected]> Co-authored-by: Nalin Gaddis <[email protected]> Co-authored-by: Nalin Gaddis <[email protected]> Co-authored-by: Preston Alvarado <[email protected]> Co-authored-by: Xiaogang <[email protected]> Co-authored-by: Yabo Hu <[email protected]> Co-authored-by: yifanz7 <[email protected]> Co-authored-by: Dante <[email protected]> Co-authored-by: yuc-Li <[email protected]> Co-authored-by: v-yuchenli <[email protected]> Co-authored-by: Adam Sandor <[email protected]> Co-authored-by: Jin Lei <[email protected]> Co-authored-by: mayankkatwal <[email protected]> Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com> Co-authored-by: myun12580 <[email protected]>
1 parent 1796f3c commit af1ac14

10 files changed

+149
-14
lines changed

src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewaySkuTier.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ public static class VirtualNetworkGatewaySkuTier
3333
public const string ErGw1AZ = "ErGw1AZ";
3434
public const string ErGw2AZ = "ErGw2AZ";
3535
public const string ErGw3AZ = "ErGw3AZ";
36+
public const string ErGwScale = "ErGwScale";
3637
}
3738
}

src/Network/Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Onboarded `Microsoft.EventGrid/namespaces` to private link cmdlets
2525
* Fixed bug in `NewAzureApplicationGatewayFirewallCustomRuleGroupByVariable` to add "GeoLocation" as a valid input for VariableName
2626
* Added breaking change message for parameter `VariableName` in `NewAzureApplicationGatewayFirewallCustomRuleGroupByVariable` to remove "Geo" as a valid input.
27+
* Added min scale units and max scale units to support autoscale for Virtual Network gateways
2728

2829
## Version 6.1.1
2930
* Onboarded `Microsoft.ElasticSan/elasticSans` to private link cmdlets

src/Network/Network/Models/PSVirtualNetworkGateway.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ public class PSVirtualNetworkGateway : PSTopLevelResource
4848
[Ps1Xml(Label = "Sku Name", Target = ViewControl.Table, ScriptBlock = "$_.Sku.Name")]
4949
public PSVirtualNetworkGatewaySku Sku { get; set; }
5050

51-
public List<PSVirtualNetworkGatewayPolicyGroup> VirtualNetworkGatewayPolicyGroups { get; set; }
51+
[Ps1Xml(Label = "AutoScaleConfiguration", Target = ViewControl.Table)]
52+
public PSVirtualNetworkGatewayAutoscaleConfiguration AutoScaleConfiguration { get; set; }
5253

54+
public List<PSVirtualNetworkGatewayPolicyGroup> VirtualNetworkGatewayPolicyGroups { get; set; }
55+
5356
public PSVpnClientConfiguration VpnClientConfiguration { get; set; }
5457

5558
public PSBgpSettings BgpSettings { get; set; }
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
using Microsoft.WindowsAzure.Commands.Common.Attributes;
17+
using Newtonsoft.Json;
18+
19+
namespace Microsoft.Azure.Commands.Network.Models
20+
{
21+
public class PSVirtualNetworkGatewayAutoscaleConfiguration
22+
{
23+
[Ps1Xml(Target = ViewControl.Table)]
24+
public PSVirtualNetworkGatewayPropertiesAutoScaleConfigurationBounds Bounds { get; set; }
25+
26+
[JsonIgnore]
27+
public string BoundsText
28+
{
29+
get { return JsonConvert.SerializeObject(Bounds, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
30+
}
31+
}
32+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
using Microsoft.WindowsAzure.Commands.Common.Attributes;
3+
4+
namespace Microsoft.Azure.Commands.Network.Models
5+
{
6+
public class PSVirtualNetworkGatewayPropertiesAutoScaleConfigurationBounds
7+
{
8+
[Ps1Xml(Target = ViewControl.Table)]
9+
public int Min { get; set; }
10+
11+
[Ps1Xml(Target = ViewControl.Table)]
12+
public int Max { get; set; }
13+
}
14+
}

src/Network/Network/Network.format.ps1xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,10 @@
976976
<Label>Sku</Label>
977977
<PropertyName>SkuText</PropertyName>
978978
</ListItem>
979+
<ListItem>
980+
<Label>AutoScaleConfiguration</Label>
981+
<PropertyName>AutoScaleConfigurationText</PropertyName>
982+
</ListItem>
979983
<ListItem>
980984
<Label>VpnClientConfiguration</Label>
981985
<PropertyName>VpnClientConfigurationText</PropertyName>
@@ -6130,6 +6134,46 @@
61306134
</ListEntries>
61316135
</ListControl>
61326136
</View>
6137+
<View>
6138+
<Name>Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayAutoscaleConfiguration</Name>
6139+
<ViewSelectedBy>
6140+
<TypeName>Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayAutoscaleConfiguration</TypeName>
6141+
</ViewSelectedBy>
6142+
<ListControl>
6143+
<ListEntries>
6144+
<ListEntry>
6145+
<ListItems>
6146+
<ListItem>
6147+
<Label>Bounds</Label>
6148+
<PropertyName>BoundsText</PropertyName>
6149+
</ListItem>
6150+
</ListItems>
6151+
</ListEntry>
6152+
</ListEntries>
6153+
</ListControl>
6154+
</View>
6155+
<View>
6156+
<Name>Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayPropertiesAutoScaleConfigurationBounds</Name>
6157+
<ViewSelectedBy>
6158+
<TypeName>Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayPropertiesAutoScaleConfigurationBounds</TypeName>
6159+
</ViewSelectedBy>
6160+
<ListControl>
6161+
<ListEntries>
6162+
<ListEntry>
6163+
<ListItems>
6164+
<ListItem>
6165+
<Label>Min</Label>
6166+
<PropertyName>Min</PropertyName>
6167+
</ListItem>
6168+
<ListItem>
6169+
<Label>Max</Label>
6170+
<PropertyName>Max</PropertyName>
6171+
</ListItem>
6172+
</ListItems>
6173+
</ListEntry>
6174+
</ListEntries>
6175+
</ListControl>
6176+
</View>
61336177
<View>
61346178
<Name>Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayConnectionIkeSaQuickModeSa</Name>
61356179
<ViewSelectedBy>

src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
namespace Microsoft.Azure.Commands.Network
3131
{
32-
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VirtualNetworkGateway",SupportsShouldProcess = true,DefaultParameterSetName = VirtualNetworkGatewayParameterSets.Default),OutputType(typeof(PSVirtualNetworkGateway))]
32+
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VirtualNetworkGateway", SupportsShouldProcess = true, DefaultParameterSetName = VirtualNetworkGatewayParameterSets.Default), OutputType(typeof(PSVirtualNetworkGateway))]
3333
public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmdlet
3434
{
3535
[Alias("ResourceName")]
@@ -144,6 +144,7 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
144144
MNM.VirtualNetworkGatewaySkuTier.ErGw1AZ,
145145
MNM.VirtualNetworkGatewaySkuTier.ErGw2AZ,
146146
MNM.VirtualNetworkGatewaySkuTier.ErGw3AZ,
147+
MNM.VirtualNetworkGatewaySkuTier.ErGwScale,
147148
IgnoreCase = true)]
148149
public string GatewaySku { get; set; }
149150

@@ -313,6 +314,12 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
313314
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
314315
public SwitchParameter AsJob { get; set; }
315316

317+
[Parameter(Mandatory = false, HelpMessage = "Set min scale units for scalable gateways")]
318+
public Int32 MinScaleUnit { get; set; }
319+
320+
[Parameter(Mandatory = false, HelpMessage = "Set max scale units for scalable gateways")]
321+
public Int32 MaxScaleUnit { get; set; }
322+
316323
[Parameter(
317324
Mandatory = false,
318325
ValueFromPipelineByPropertyName = true,
@@ -324,7 +331,7 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
324331
[PSArgumentCompleter(
325332
"Enabled",
326333
"Disabled")]
327-
public string AdminState { get; set; }
334+
public string AdminState { get; set; }
328335

329336
public override void Execute()
330337
{
@@ -337,7 +344,7 @@ public override void Execute()
337344
var isCertConfigured = (this.VpnClientRootCertificates != null && this.VpnClientRootCertificates.Count() > 0) || (this.VpnClientRevokedCertificates != null && this.VpnClientRevokedCertificates.Count() > 0);
338345
var isRadiusConfigured = !string.IsNullOrEmpty(this.RadiusServerAddress) && this.RadiusServerSecret != null && !string.IsNullOrEmpty(SecureStringExtensions.ConvertToString(this.RadiusServerSecret));
339346
var isAadConfigured = this.AadTenantUri != null && this.AadAudienceId != null && this.AadIssuerUri != null;
340-
347+
341348
if (!string.IsNullOrEmpty(GatewaySku)
342349
&& GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.UltraPerformance, StringComparison.InvariantCultureIgnoreCase))
343350
{
@@ -502,7 +509,7 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
502509
vnetGateway.VpnClientConfiguration.RadiusServerAddress = this.RadiusServerAddress;
503510
vnetGateway.VpnClientConfiguration.RadiusServerSecret = SecureStringExtensions.ConvertToString(this.RadiusServerSecret);
504511
}
505-
512+
506513
if (this.RadiusServerList != null && this.RadiusServerList.Any())
507514
{
508515
vnetGateway.VpnClientConfiguration.RadiusServers = this.RadiusServerList?.ToList();
@@ -543,12 +550,12 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
543550

544551
if (this.ClientConnectionConfiguration != null && this.ClientConnectionConfiguration.Any())
545552
{
546-
foreach( var config in this.ClientConnectionConfiguration)
553+
foreach (var config in this.ClientConnectionConfiguration)
547554
{
548-
foreach (var policyGroup in config.VirtualNetworkGatewayPolicyGroups)
555+
foreach (var policyGroup in config.VirtualNetworkGatewayPolicyGroups)
549556
{
550557
policyGroup.Id = string.Format("/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/virtualNetworkGateways/{2}/virtualNetworkGatewayPolicyGroups/{3}", this.NetworkClient.NetworkManagementClient.SubscriptionId, vnetGateway.ResourceGroupName, Name, policyGroup.Id);
551-
}
558+
}
552559
}
553560
vnetGateway.VpnClientConfiguration.ClientConnectionConfigurations = this.ClientConnectionConfiguration.ToList();
554561
}
@@ -580,12 +587,12 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
580587

581588
if (this.IpConfigurationBgpPeeringAddresses != null)
582589
{
583-
if(vnetGateway.BgpSettings == null)
590+
if (vnetGateway.BgpSettings == null)
584591
{
585592
vnetGateway.BgpSettings = new PSBgpSettings();
586593
}
587594

588-
if(this.IpConfigurationBgpPeeringAddresses.Any(address => address.CustomBgpIpAddresses == null || !address.CustomBgpIpAddresses.Any()))
595+
if (this.IpConfigurationBgpPeeringAddresses.Any(address => address.CustomBgpIpAddresses == null || !address.CustomBgpIpAddresses.Any()))
589596
{
590597
throw new ArgumentException("if IpConfigurationBgpPeeringAddresses are provided, CustomBgpIpAddresses must be a provided in create gateway");
591598
}
@@ -598,7 +605,7 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
598605
vnetGateway.BgpSettings.BgpPeeringAddresses.Add(address);
599606
}
600607
}
601-
else if(vnetGateway.BgpSettings != null)
608+
else if (vnetGateway.BgpSettings != null)
602609
{
603610
vnetGateway.BgpSettings.BgpPeeringAddresses = null;
604611
}
@@ -639,7 +646,20 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
639646

640647
vnetGateway.AdminState = this.AdminState;
641648
}
642-
649+
650+
// set the min scale units and the max scale units
651+
if (!string.IsNullOrEmpty(this.GatewaySku) && this.GatewaySku.Equals(MNM.VirtualNetworkGatewaySkuTier.ErGwScale))
652+
{
653+
if (this.MaxScaleUnit > 0 && this.MinScaleUnit > this.MaxScaleUnit)
654+
{
655+
throw new PSArgumentException(string.Format(Properties.Resources.InvalidAutoScaleConfiguration, this.MinScaleUnit, this.MaxScaleUnit));
656+
}
657+
658+
vnetGateway.AutoScaleConfiguration = new PSVirtualNetworkGatewayAutoscaleConfiguration();
659+
vnetGateway.AutoScaleConfiguration.Bounds = new PSVirtualNetworkGatewayPropertiesAutoScaleConfigurationBounds();
660+
vnetGateway.AutoScaleConfiguration.Bounds.Min = Convert.ToInt32(this.MinScaleUnit);
661+
vnetGateway.AutoScaleConfiguration.Bounds.Max = (this.MaxScaleUnit > 0) ? Convert.ToInt32(this.MaxScaleUnit) : Convert.ToInt32(this.MinScaleUnit);
662+
}
643663
// Set the EnableBgpRouteTranslationForNat, if it is specified by customer.
644664
vnetGateway.EnableBgpRouteTranslationForNat = EnableBgpRouteTranslationForNat.IsPresent;
645665

@@ -655,4 +675,4 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
655675
return getVirtualNetworkGateway;
656676
}
657677
}
658-
}
678+
}

src/Network/Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
6060
MNM.VirtualNetworkGatewaySkuTier.ErGw1AZ,
6161
MNM.VirtualNetworkGatewaySkuTier.ErGw2AZ,
6262
MNM.VirtualNetworkGatewaySkuTier.ErGw3AZ,
63+
MNM.VirtualNetworkGatewaySkuTier.ErGwScale,
6364
IgnoreCase = true)]
6465
public string GatewaySku { get; set; }
6566

@@ -213,6 +214,11 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
213214
HelpMessage = "This will enable and disable BgpRouteTranslationForNat on this VirtualNetworkGateway.")]
214215
public bool? BgpRouteTranslationForNat { get; set; }
215216

217+
[Parameter(Mandatory = false, HelpMessage = "Set min scale units for scalable gateways")]
218+
public Int32 MinScaleUnit { get; set; }
219+
220+
[Parameter(Mandatory = false, HelpMessage = "Set max scale units for scalable gateways")]
221+
public Int32 MaxScaleUnit { get; set; }
216222

217223
[Parameter(
218224
Mandatory = false,
@@ -531,6 +537,19 @@ public override void Execute()
531537
this.VirtualNetworkGateway.AdminState = AdminState;
532538
}
533539

540+
if (!string.IsNullOrEmpty(this.VirtualNetworkGateway.Sku.Name) && (this.VirtualNetworkGateway.Sku.Name.Equals(MNM.VirtualNetworkGatewaySkuTier.ErGwScale) && (this.MinScaleUnit > 0 || this.MaxScaleUnit > 0)))
541+
{
542+
if (this.MinScaleUnit > this.MaxScaleUnit)
543+
{
544+
throw new PSArgumentException(string.Format(Properties.Resources.InvalidAutoScaleConfiguration, this.MinScaleUnit, this.MaxScaleUnit));
545+
}
546+
547+
this.VirtualNetworkGateway.AutoScaleConfiguration = new PSVirtualNetworkGatewayAutoscaleConfiguration();
548+
this.VirtualNetworkGateway.AutoScaleConfiguration.Bounds = new PSVirtualNetworkGatewayPropertiesAutoScaleConfigurationBounds();
549+
this.VirtualNetworkGateway.AutoScaleConfiguration.Bounds.Min = Convert.ToInt32(this.MinScaleUnit);
550+
this.VirtualNetworkGateway.AutoScaleConfiguration.Bounds.Max = Convert.ToInt32(this.MaxScaleUnit);
551+
}
552+
534553
// Map to the sdk object
535554
MNM.VirtualNetworkGateway sdkVirtualNetworkGateway = NetworkResourceManagerProfile.Mapper.Map<MNM.VirtualNetworkGateway>(this.VirtualNetworkGateway);
536555
sdkVirtualNetworkGateway.Tags =

src/Network/Network/help/New-AzVirtualNetworkGateway.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ New-AzVirtualNetworkGateway -Name <String> -ResourceGroupName <String> -Location
1818
[-IpConfigurations <PSVirtualNetworkGatewayIpConfiguration[]>] [-GatewayType <String>]
1919
[-ExtendedLocation <String>] [-VNetExtendedLocationResourceId <String>] [-VpnType <String>]
2020
[-EnableBgp <Boolean>] [-DisableIPsecProtection <Boolean>] [-EnableActiveActiveFeature]
21+
[-MinScaleUnit <Int32>] [-MaxScaleUnit <Int32>]
2122
[-EnablePrivateIpAddress] [-GatewaySku <String>] [-GatewayDefaultSite <PSLocalNetworkGateway>]
2223
[-VpnClientAddressPool <String[]>] [-VpnClientProtocol <String[]>] [-VpnAuthenticationType <String[]>]
2324
[-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]

src/Network/Network/help/Set-AzVirtualNetworkGateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Set-AzVirtualNetworkGateway -VirtualNetworkGateway <PSVirtualNetworkGateway> [-G
2020
[-VpnClientProtocol <String[]>] [-VpnAuthenticationType <String[]>]
2121
[-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
2222
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
23-
[-Asn <UInt32>] [-PeerWeight <Int32>]
23+
[-Asn <UInt32>] [-PeerWeight <Int32>] [-MinScaleUnit <Int32>] [-MaxScaleUnit <Int32>]
2424
[-IpConfigurationBgpPeeringAddresses <PSIpConfigurationBgpPeeringAddress[]>] [-EnableActiveActiveFeature]
2525
[-EnablePrivateIpAddress <Boolean>] [-DisableActiveActiveFeature] [-RadiusServerAddress <String>]
2626
[-RadiusServerSecret <SecureString>] [-RadiusServerList <PSRadiusServer[]>] [-AadTenantUri <String>]

0 commit comments

Comments
 (0)