Skip to content

Commit 8ed242c

Browse files
authored
Merge pull request #17989 from Azure/network-2021-08-01-final
Network 2021 08 01 is delivering final version of monthly
2 parents bb4301a + d3aa5d3 commit 8ed242c

File tree

52 files changed

+3756
-708
lines changed

Some content is hidden

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

52 files changed

+3756
-708
lines changed

src/Batch/Batch.Test/Batch.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PackageReference Include="Microsoft.Azure.Batch" Version="15.3.0" />
1717
<PackageReference Include="Microsoft.Azure.Management.Batch" Version="14.0.0" />
1818
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
19-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
19+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

src/CognitiveServices/CognitiveServices.Test/CognitiveServices.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<PsModuleName>CognitiveServices</PsModuleName>
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="8.2.0" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

src/Compute/Compute.Test/Compute.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
1515
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="54.0.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
17-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
17+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/ContainerRegistry/ContainerRegistry.Test/ContainerRegistry.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.ContainerRegistry" Version="4.0.0" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1616
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />
1717
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0">
1818
<NoWarn>NU1608</NoWarn>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<PsModuleName>CosmosDB</PsModuleName>
44
</PropertyGroup>
55
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
66
<ItemGroup>
77
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.1" />
88
<PackageReference Include="Microsoft.Azure.Management.CosmosDB" Version="3.5.0-preview" />
9-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
9+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1010
</ItemGroup>
1111
</Project>

src/DataLakeStore/DataLakeStore.Test/DataLakeStore.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.DataLake.Store" Version="2.4.2-preview" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

src/Dns/Dns.Test/Dns.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.Dns" Version="3.0.1" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1616
</ItemGroup>
1717

1818
</Project>

src/HDInsight/HDInsight.Test/HDInsight.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<PsModuleName>HDInsight</PsModuleName>
@@ -16,7 +16,7 @@
1616
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
1717
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
1818
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />
19-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
19+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
2020
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.24.0-preview" />
2121
</ItemGroup>
2222

src/HPCCache/HPCCache.Test/HPCCache.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<ItemGroup>
1818
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.13.0-preview" />
1919
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.5.0" />
20-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
20+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
2121
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
2222
</ItemGroup>
2323

src/KeyVault/KeyVault.Test/KeyVault.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.1" />
1515
<PackageReference Include="Microsoft.Azure.KeyVault.WebKey" Version="3.0.1" />
1616
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
17-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
17+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/Monitor/Monitor.Test/Monitor.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.Monitor" Version="0.26.0-preview" />
1515
<PackageReference Include="Microsoft.Azure.Management.ApplicationInsights" Version="0.3.0-preview" />
16-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
16+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1717
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.24.0-preview" />
1818
</ItemGroup>
1919

src/NetAppFiles/NetAppFiles.Test/NetAppFiles.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.15.0" />
15-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1616
</ItemGroup>
1717

1818
</Project>

src/Network/Network.Test/Network.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
17-
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
17+
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
1818
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
1919
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
2020
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />

src/Network/Network.Test/ScenarioTests/CortexTests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function Test-CortexCRUD
6868
Assert-NotNull $virtualWansAll
6969

7070
# Create the Virtual Hub
71-
$createdVirtualHub = New-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -Location $rglocation -AddressPrefix "192.168.1.0/24" -VirtualWan $virtualWan
71+
$createdVirtualHub = New-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -Location $rglocation -AddressPrefix "192.168.1.0/24" -VirtualWan $virtualWan -HubRoutingPreference "ASPath"
7272
$virtualHub = Get-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName
7373
Assert-AreEqual $rgName $virtualHub.ResourceGroupName
7474
Assert-AreEqual $virtualHubName $virtualHub.Name
@@ -94,7 +94,7 @@ function Test-CortexCRUD
9494
$route1 = New-AzVirtualHubRoute -AddressPrefix @("10.0.0.0/16", "11.0.0.0/16") -NextHopIpAddress "12.0.0.5"
9595
$route2 = New-AzVirtualHubRoute -AddressPrefix @("13.0.0.0/16") -NextHopIpAddress "14.0.0.5"
9696
$routeTable = New-AzVirtualHubRouteTable -Route @($route1, $route2)
97-
Update-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -RouteTable $routeTable
97+
Update-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -RouteTable $routeTable -HubRoutingPreference "ExpressRoute"
9898
$virtualHub = Get-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName
9999
Assert-AreEqual $rgName $virtualHub.ResourceGroupName
100100
Assert-AreEqual $virtualHubName $virtualHub.Name

src/Network/Network.Test/ScenarioTests/ExpressRoutePortTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,12 @@ public void TestExpressRoutePortGenerateLOA()
4949
TestRunner.RunTestScript("Test-ExpressRoutePortGenerateLOA");
5050
}
5151

52+
[Fact(Skip = "No bandwidth available")]
53+
[Trait(Category.AcceptanceType, Category.CheckIn)]
54+
[Trait(Category.Owner, NrpTeamAlias.pgtm)]
55+
public void TestExpressRoutePortAuthorizationCRUD()
56+
{
57+
TestRunner.RunTestScript("Test-ExpressRoutePortAuthorizationCRUD");
58+
}
5259
}
5360
}

src/Network/Network.Test/ScenarioTests/ExpressRoutePortTests.ps1

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,69 @@ function Test-ExpressRoutePortGenerateLOA
228228
}
229229
}
230230

231+
<#
232+
.SYNOPSIS
233+
Tests ExpressRoutePortAuthorizationCRUD.
234+
#>
235+
function Test-ExpressRoutePortAuthorizationCRUD
236+
{
237+
# Setup
238+
$rgname = Get-ResourceGroupName
239+
$rglocation = Get-ProviderLocation ResourceManagement
240+
$rname = Get-ResourceName
241+
$resourceTypeParent = "Microsoft.Network/expressRoutePorts"
242+
$location = Get-ProviderLocation $resourceTypeParent
243+
$peeringLocation = "Area51-ERDirect"
244+
$encapsulation = "QinQ"
245+
$bandwidthInGbps = 100.0
246+
$authorizationName = "testkey"
247+
248+
try
249+
{
250+
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation
251+
252+
# Create the ExpressRoutePort
253+
$expressRoutePort = New-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname -Location $location -PeeringLocation $peeringLocation -Encapsulation $encapsulation -BandwidthInGbps $bandwidthInGbps
254+
255+
#verification
256+
Assert-NotNull $expressRoutePort
257+
Assert-AreEqual $rname $expressRoutePort.Name
258+
259+
# add a new authorization
260+
Get-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname | Add-AzExpressRoutePortAuthorization -Name "testkey1"
261+
262+
# get the authorization
263+
$a = $expressRoutePort | Get-AzExpressRoutePortAuthorization -Name "testkey1"
264+
Assert-AreEqual "testkey1" $a.Name
265+
266+
# add another new authorization
267+
Get-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname | Add-AzExpressRoutePortAuthorization -Name "testkey2"
268+
269+
$a = $expressRoutePort | Get-AzExpressRoutePortAuthorization -Name "testkey2"
270+
Assert-AreEqual "testkey2" $a.Name
271+
272+
# list authorizations
273+
$listAuthorization = $expressRoutePort | Get-AzExpressRoutePortAuthorization
274+
Assert-AreEqual 2 @($listAuthorization).Count
275+
276+
# delete an authorization
277+
Get-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname | Remove-AzExpressRoutePortAuthorization -Name "testkey1" -Force
278+
279+
# list authorizations again
280+
$listAuthorization = $expressRoutePort | Get-AzExpressRoutePortAuthorization
281+
Assert-AreEqual 1 @($listAuthorization).Count
282+
283+
# Delete ExpressRoutePort
284+
$removeExpressRoutePort = Remove-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname -PassThru -Force
285+
Assert-AreEqual $true $removeExpressRoutePort
286+
287+
$list = Get-AzExpressRoutePort -ResourceGroupName $rgname
288+
Assert-AreEqual 0 @($list).Count
289+
}
290+
finally
291+
{
292+
# Cleanup
293+
Clean-ResourceGroup $rgname
294+
}
295+
}
296+

src/Network/Network.Test/ScenarioTests/NetworkInterfaceTests.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ function Test-NetworkInterfaceCRUD
118118
$publicIpName = Get-ResourceName
119119
$nicName = Get-ResourceName
120120
$domainNameLabel = Get-ResourceName
121-
$rglocation = Get-ProviderLocation ResourceManagement
121+
$rglocation = Get-ProviderLocation ResourceManagement "East US 2 EUAP"
122122
$resourceTypeParent = "Microsoft.Network/networkInterfaces"
123-
$location = Get-ProviderLocation $resourceTypeParent
123+
$location = Get-ProviderLocation $resourceTypeParent "East US 2 EUAP"
124124

125125
try
126126
{
@@ -135,7 +135,7 @@ function Test-NetworkInterfaceCRUD
135135
$publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel
136136

137137
# Create NetworkInterface
138-
$actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip
138+
$actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip -EnableAcceleratedNetworking -AuxiliaryMode MaxConnections -Tag @{ fastpathenabled = "true"}
139139
$expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname
140140

141141
Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName
@@ -148,6 +148,7 @@ function Test-NetworkInterfaceCRUD
148148
Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id
149149
Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress
150150
Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod
151+
Assert-AreEqual "MaxConnections" $expectedNic.AuxiliaryMode
151152

152153
$expectedNic = Get-AzNetworkInterface -ResourceId $actualNic.Id
153154

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.ExpressRoutePortTests/TestExpressRoutePortAuthorizationCRUD.json

Lines changed: 2139 additions & 0 deletions
Large diffs are not rendered by default.

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkInterfaceTests/TestNetworkInterfaceCRUD.json

Lines changed: 427 additions & 658 deletions
Large diffs are not rendered by default.

src/Network/Network/Az.Network.psd1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate',
255255
'Get-AzExpressRoutePortIdentity', 'New-AzExpressRoutePortIdentity',
256256
'Remove-AzExpressRoutePortIdentity',
257257
'Set-AzExpressRoutePortIdentity',
258+
'Add-AzExpressRoutePortAuthorization',
259+
'Get-AzExpressRoutePortAuthorization',
260+
'Remove-AzExpressRoutePortAuthorization',
258261
'Get-AzEffectiveNetworkSecurityGroup', 'Get-AzEffectiveRouteTable',
259262
'Add-AzNetworkInterfaceIpConfig', 'Get-AzNetworkInterfaceIpConfig',
260263
'New-AzNetworkInterfaceIpConfig',

src/Network/Network/ChangeLog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Added new cmdlets to create/manage authorization objects for ExpressRoutePort:
23+
- `Add-AzExpressRoutePortAuthorization`
24+
- `Get-AzExpressRoutePortAuthorization`
25+
- `Remove-AzExpressRoutePortAuthorization`
26+
* Added option parameter `AuthorizationKey` to cmdlet `New-AzExpressRouteCircuit` to allow creating ExpressRoute Circuit on a ExpressRoutePort with a different owner.
27+
* Fix bug that can't display CustomIpPrefix in PublicIpPrefix.
28+
* Updated cmdlets to add new property of `HubRoutingPreference` in VirtualHub and set property of `PreferredRoutingGateway` deprecated .
29+
- `New-AzVirtualHub`
30+
- `Update-AzVirtualHub`
31+
* Added optional parameter `AuxiliaryMode` to cmdlet `New-AzNetworkInterface` to enable this network interface as Sirius enabled. Allowed values are None(default) and MaxConnections.
2232

2333
## Version 4.16.1
2434
* Fixed `ArgumentNullException` in `Add-AzureRmRouteConfig` when `RouteTable.Routes` is null.

src/Network/Network/Common/NetworkResourceManagerProfile.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,12 @@ private static void Initialize()
792792
// CNM to MNM
793793
cfg.CreateMap<CNM.PSExpressRoutePort, MNM.ExpressRoutePort>();
794794
cfg.CreateMap<CNM.PSExpressRouteLink, MNM.ExpressRouteLink>();
795+
cfg.CreateMap<CNM.PSExpressRoutePortAuthorization, MNM.ExpressRoutePortAuthorization>();
795796

796797
// MNM to CNM
797798
cfg.CreateMap<MNM.ExpressRoutePort, CNM.PSExpressRoutePort>();
798799
cfg.CreateMap<MNM.ExpressRouteLink, CNM.PSExpressRouteLink>();
800+
cfg.CreateMap<MNM.ExpressRoutePortAuthorization, CNM.PSExpressRoutePortAuthorization>();
799801

800802
// ExpressRouteCircuit
801803
// CNM to MNM

src/Network/Network/Cortex/CortexParameterSetNames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ internal static class CortexParameterSetNames
8484
internal const string ByHubBgpConnectionObject = "ByHubBgpConnectionObject";
8585
internal const string ByHubBgpConnectionResourceId = "ByHubBgpConnectionResourceId";
8686

87-
}
87+
}
8888
}

src/Network/Network/Cortex/VirtualHub/NewAzureRmVirtualHubCommand.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public class NewAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
9898
[PSArgumentCompleter("Basic", "Standard")]
9999
public string Sku { get; set; }
100100

101+
public const String PreferredGWChangeDesc = "PreferredRoutingGateway parameter is deprecated. Use *HubRoutingPreference* property";
102+
[CmdletParameterBreakingChange("PreferredRoutingGateway", ChangeDescription = PreferredGWChangeDesc)]
101103
[Parameter(
102104
Mandatory = false,
103105
HelpMessage = "Preferred Routing Gateway to Route On-Prem traffic from VNET")]
@@ -107,6 +109,16 @@ public class NewAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
107109
IgnoreCase = true)]
108110
public string PreferredRoutingGateway { get; set; }
109111

112+
[Parameter(
113+
Mandatory = false,
114+
HelpMessage = "Virtual Hub Routing Preference to route traffic")]
115+
[ValidateSet(
116+
MNM.HubRoutingPreference.ExpressRoute,
117+
MNM.HubRoutingPreference.VpnGateway,
118+
MNM.HubRoutingPreference.ASPath,
119+
IgnoreCase = true)]
120+
public string HubRoutingPreference { get; set; }
121+
110122
[Parameter(
111123
Mandatory = false,
112124
HelpMessage = "Run cmdlet in the background")]
@@ -183,6 +195,15 @@ public override void Execute()
183195
virtualHub.PreferredRoutingGateway = this.PreferredRoutingGateway;
184196
}
185197

198+
if (string.IsNullOrWhiteSpace(this.HubRoutingPreference))
199+
{
200+
virtualHub.HubRoutingPreference = "ExpressRoute";
201+
}
202+
else
203+
{
204+
virtualHub.HubRoutingPreference = this.HubRoutingPreference;
205+
}
206+
186207
WriteObject(CreateOrUpdateVirtualHub(
187208
this.ResourceGroupName,
188209
this.Name,

src/Network/Network/Cortex/VirtualHub/UpdateAzureRmVirtualHubCommand.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public class UpdateAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
103103
[PSArgumentCompleter("Basic", "Standard")]
104104
public string Sku { get; set; }
105105

106+
public const String PreferredGWChangeDesc = "PreferredRoutingGateway parameter will be deprecated. Use *HubRoutingPreference* parameter";
107+
[CmdletParameterBreakingChange("PreferredRoutingGateway", ChangeDescription = PreferredGWChangeDesc)]
106108
[Parameter(
107109
Mandatory = false,
108110
HelpMessage = "Preferred Routing Gateway to Route On-Prem traffic from VNET")]
@@ -112,6 +114,16 @@ public class UpdateAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
112114
IgnoreCase = true)]
113115
public string PreferredRoutingGateway { get; set; }
114116

117+
[Parameter(
118+
Mandatory = false,
119+
HelpMessage = "Virtual Hub Routing Preference to route traffic")]
120+
[ValidateSet(
121+
MNM.HubRoutingPreference.ExpressRoute,
122+
MNM.HubRoutingPreference.VpnGateway,
123+
MNM.HubRoutingPreference.ASPath,
124+
IgnoreCase = true)]
125+
public string HubRoutingPreference { get; set; }
126+
115127
[Parameter(
116128
Mandatory = false,
117129
HelpMessage = "Run cmdlet in the background")]
@@ -194,6 +206,11 @@ public override void Execute()
194206
virtualHubToUpdate.PreferredRoutingGateway = this.PreferredRoutingGateway;
195207
}
196208

209+
if (!string.IsNullOrWhiteSpace(this.HubRoutingPreference))
210+
{
211+
virtualHubToUpdate.HubRoutingPreference = this.HubRoutingPreference;
212+
}
213+
197214
//// Update the virtual hub
198215
ConfirmAction(
199216
Properties.Resources.SettingResourceMessage,

0 commit comments

Comments
 (0)