Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network 2021 08 01 is delivering final version of monthly #17989

Merged
merged 7 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Batch/Batch.Test/Batch.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Azure.Batch" Version="15.3.0" />
<PackageReference Include="Microsoft.Azure.Management.Batch" Version="14.0.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PsModuleName>CognitiveServices</PsModuleName>
Expand All @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="8.2.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Compute/Compute.Test/Compute.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="54.0.0" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ContainerRegistry" Version="4.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0">
<NoWarn>NU1608</NoWarn>
Expand Down
4 changes: 2 additions & 2 deletions src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PsModuleName>CosmosDB</PsModuleName>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
<ItemGroup>
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.CosmosDB" Version="3.5.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.DataLake.Store" Version="2.4.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Dns/Dns.Test/Dns.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Dns" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/HDInsight/HDInsight.Test/HDInsight.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PsModuleName>HDInsight</PsModuleName>
Expand All @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.24.0-preview" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/HPCCache/HPCCache.Test/HPCCache.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.13.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.5.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/KeyVault/KeyVault.Test/KeyVault.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.KeyVault.WebKey" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor.Test/Monitor.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Monitor" Version="0.26.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.ApplicationInsights" Version="0.3.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.24.0-preview" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/NetAppFiles/NetAppFiles.Test/NetAppFiles.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.15.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Network/Network.Test/Network.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="21.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="22.0.0" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="4.0.0-preview.1" />
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Network.Test/ScenarioTests/CortexTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Test-CortexCRUD
Assert-NotNull $virtualWansAll

# Create the Virtual Hub
$createdVirtualHub = New-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -Location $rglocation -AddressPrefix "192.168.1.0/24" -VirtualWan $virtualWan
$createdVirtualHub = New-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -Location $rglocation -AddressPrefix "192.168.1.0/24" -VirtualWan $virtualWan -HubRoutingPreference "ASPath"
$virtualHub = Get-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName
Assert-AreEqual $rgName $virtualHub.ResourceGroupName
Assert-AreEqual $virtualHubName $virtualHub.Name
Expand All @@ -94,7 +94,7 @@ function Test-CortexCRUD
$route1 = New-AzVirtualHubRoute -AddressPrefix @("10.0.0.0/16", "11.0.0.0/16") -NextHopIpAddress "12.0.0.5"
$route2 = New-AzVirtualHubRoute -AddressPrefix @("13.0.0.0/16") -NextHopIpAddress "14.0.0.5"
$routeTable = New-AzVirtualHubRouteTable -Route @($route1, $route2)
Update-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -RouteTable $routeTable
Update-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -RouteTable $routeTable -HubRoutingPreference "ExpressRoute"
$virtualHub = Get-AzVirtualHub -ResourceGroupName $rgName -Name $virtualHubName
Assert-AreEqual $rgName $virtualHub.ResourceGroupName
Assert-AreEqual $virtualHubName $virtualHub.Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,12 @@ public void TestExpressRoutePortGenerateLOA()
TestRunner.RunTestScript("Test-ExpressRoutePortGenerateLOA");
}

[Fact(Skip = "No bandwidth available")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.pgtm)]
public void TestExpressRoutePortAuthorizationCRUD()
{
TestRunner.RunTestScript("Test-ExpressRoutePortAuthorizationCRUD");
}
}
}
66 changes: 66 additions & 0 deletions src/Network/Network.Test/ScenarioTests/ExpressRoutePortTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,69 @@ function Test-ExpressRoutePortGenerateLOA
}
}

<#
.SYNOPSIS
Tests ExpressRoutePortAuthorizationCRUD.
#>
function Test-ExpressRoutePortAuthorizationCRUD
{
# Setup
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$rname = Get-ResourceName
$resourceTypeParent = "Microsoft.Network/expressRoutePorts"
$location = Get-ProviderLocation $resourceTypeParent
$peeringLocation = "Area51-ERDirect"
$encapsulation = "QinQ"
$bandwidthInGbps = 100.0
$authorizationName = "testkey"

try
{
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation

# Create the ExpressRoutePort
$expressRoutePort = New-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname -Location $location -PeeringLocation $peeringLocation -Encapsulation $encapsulation -BandwidthInGbps $bandwidthInGbps

#verification
Assert-NotNull $expressRoutePort
Assert-AreEqual $rname $expressRoutePort.Name

# add a new authorization
Get-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname | Add-AzExpressRoutePortAuthorization -Name "testkey1"

# get the authorization
$a = $expressRoutePort | Get-AzExpressRoutePortAuthorization -Name "testkey1"
Assert-AreEqual "testkey1" $a.Name

# add another new authorization
Get-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname | Add-AzExpressRoutePortAuthorization -Name "testkey2"

$a = $expressRoutePort | Get-AzExpressRoutePortAuthorization -Name "testkey2"
Assert-AreEqual "testkey2" $a.Name

# list authorizations
$listAuthorization = $expressRoutePort | Get-AzExpressRoutePortAuthorization
Assert-AreEqual 2 @($listAuthorization).Count

# delete an authorization
Get-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname | Remove-AzExpressRoutePortAuthorization -Name "testkey1" -Force

# list authorizations again
$listAuthorization = $expressRoutePort | Get-AzExpressRoutePortAuthorization
Assert-AreEqual 1 @($listAuthorization).Count

# Delete ExpressRoutePort
$removeExpressRoutePort = Remove-AzExpressRoutePort -ResourceGroupName $rgname -Name $rname -PassThru -Force
Assert-AreEqual $true $removeExpressRoutePort

$list = Get-AzExpressRoutePort -ResourceGroupName $rgname
Assert-AreEqual 0 @($list).Count
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ function Test-NetworkInterfaceCRUD
$publicIpName = Get-ResourceName
$nicName = Get-ResourceName
$domainNameLabel = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$rglocation = Get-ProviderLocation ResourceManagement "East US 2 EUAP"
$resourceTypeParent = "Microsoft.Network/networkInterfaces"
$location = Get-ProviderLocation $resourceTypeParent
$location = Get-ProviderLocation $resourceTypeParent "East US 2 EUAP"

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

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

Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName
Expand All @@ -148,6 +148,7 @@ function Test-NetworkInterfaceCRUD
Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id
Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress
Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod
Assert-AreEqual "MaxConnections" $expectedNic.AuxiliaryMode

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

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/Network/Network/Az.Network.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate',
'Get-AzExpressRoutePortIdentity', 'New-AzExpressRoutePortIdentity',
'Remove-AzExpressRoutePortIdentity',
'Set-AzExpressRoutePortIdentity',
'Add-AzExpressRoutePortAuthorization',
'Get-AzExpressRoutePortAuthorization',
'Remove-AzExpressRoutePortAuthorization',
'Get-AzEffectiveNetworkSecurityGroup', 'Get-AzEffectiveRouteTable',
'Add-AzNetworkInterfaceIpConfig', 'Get-AzNetworkInterfaceIpConfig',
'New-AzNetworkInterfaceIpConfig',
Expand Down
10 changes: 10 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
--->

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

## Version 4.16.1
* Fixed `ArgumentNullException` in `Add-AzureRmRouteConfig` when `RouteTable.Routes` is null.
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Network/Common/NetworkResourceManagerProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,12 @@ private static void Initialize()
// CNM to MNM
cfg.CreateMap<CNM.PSExpressRoutePort, MNM.ExpressRoutePort>();
cfg.CreateMap<CNM.PSExpressRouteLink, MNM.ExpressRouteLink>();
cfg.CreateMap<CNM.PSExpressRoutePortAuthorization, MNM.ExpressRoutePortAuthorization>();

// MNM to CNM
cfg.CreateMap<MNM.ExpressRoutePort, CNM.PSExpressRoutePort>();
cfg.CreateMap<MNM.ExpressRouteLink, CNM.PSExpressRouteLink>();
cfg.CreateMap<MNM.ExpressRoutePortAuthorization, CNM.PSExpressRoutePortAuthorization>();

// ExpressRouteCircuit
// CNM to MNM
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Network/Cortex/CortexParameterSetNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ internal static class CortexParameterSetNames
internal const string ByHubBgpConnectionObject = "ByHubBgpConnectionObject";
internal const string ByHubBgpConnectionResourceId = "ByHubBgpConnectionResourceId";

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public class NewAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
[PSArgumentCompleter("Basic", "Standard")]
public string Sku { get; set; }

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

[Parameter(
Mandatory = false,
HelpMessage = "Virtual Hub Routing Preference to route traffic")]
[ValidateSet(
MNM.HubRoutingPreference.ExpressRoute,
MNM.HubRoutingPreference.VpnGateway,
MNM.HubRoutingPreference.ASPath,
IgnoreCase = true)]
public string HubRoutingPreference { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Run cmdlet in the background")]
Expand Down Expand Up @@ -183,6 +195,15 @@ public override void Execute()
virtualHub.PreferredRoutingGateway = this.PreferredRoutingGateway;
}

if (string.IsNullOrWhiteSpace(this.HubRoutingPreference))
{
virtualHub.HubRoutingPreference = "ExpressRoute";
}
else
{
virtualHub.HubRoutingPreference = this.HubRoutingPreference;
}

WriteObject(CreateOrUpdateVirtualHub(
this.ResourceGroupName,
this.Name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public class UpdateAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
[PSArgumentCompleter("Basic", "Standard")]
public string Sku { get; set; }

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

[Parameter(
Mandatory = false,
HelpMessage = "Virtual Hub Routing Preference to route traffic")]
[ValidateSet(
MNM.HubRoutingPreference.ExpressRoute,
MNM.HubRoutingPreference.VpnGateway,
MNM.HubRoutingPreference.ASPath,
IgnoreCase = true)]
public string HubRoutingPreference { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Run cmdlet in the background")]
Expand Down Expand Up @@ -194,6 +206,11 @@ public override void Execute()
virtualHubToUpdate.PreferredRoutingGateway = this.PreferredRoutingGateway;
}

if (!string.IsNullOrWhiteSpace(this.HubRoutingPreference))
{
virtualHubToUpdate.HubRoutingPreference = this.HubRoutingPreference;
}

//// Update the virtual hub
ConfirmAction(
Properties.Resources.SettingResourceMessage,
Expand Down
Loading