Skip to content

Monthly release of Azure Networking #15182

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

Closed
wants to merge 4 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ public void TestVirtualNetworkInEdgeZone()
TestRunner.RunTestScript("Test-VirtualNetworkInEdgeZone");
}
}
}
}
11 changes: 5 additions & 6 deletions src/Network/Network.Test/ScenarioTests/VirtualNetworkTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,6 @@ function Test-VirtualNetworkSubnetServiceEndpointPolicies

<#
.SYNOPSIS
<<<<<<< HEAD
Tests creating new virtual network with flow timeout.
#>
function Test-VirtualNetworkCRUD-FlowTimeout
Expand Down Expand Up @@ -1474,11 +1473,11 @@ Tests whether virtual network put to an edge zone is successful.
function Test-VirtualNetworkInEdgeZone
{
# Setup
$ResourceGroup = Get-ResourceGroupName;
$ResourceGroup = Get-ResourceGroupName;
$LocationName = "westus";
$EdgeZone = "microsoftlosangeles1";

$NetworkName = "MyNet";
$NetworkName = "MyNet";
$SubnetName = "MySubnet";
$SubnetAddressPrefix = "10.0.0.0/24";
$VnetAddressPrefix = "10.0.0.0/16";
Expand All @@ -1487,11 +1486,11 @@ function Test-VirtualNetworkInEdgeZone
# Create the resource group
New-AzResourceGroup -Name $ResourceGroup -Location $LocationName -Force;

$SingleSubnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix;
$SingleSubnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix;
New-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroup -Location $LocationName -EdgeZone $EdgeZone -AddressPrefix $VnetAddressPrefix -Subnet $SingleSubnet;

$Vnet = Get-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroup
Assert-AreEqual $Vnet.ExtendedLocation.Name $EdgeZone
$Vnet = Get-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroup
Assert-AreEqual $Vnet.ExtendedLocation.Name $EdgeZone
}
finally
{
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Network/help/New-AzVirtualNetwork.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Creates a virtual network.
## SYNTAX

```
New-AzVirtualNetwork -Name <String> -ResourceGroupName <String> -Location <String> [-EdgeZone <String>] -AddressPrefix <String[]>
New-AzVirtualNetwork -Name <String> -ResourceGroupName <String> -Location <String> -AddressPrefix <String[]> [-EdgeZone <String>]
[-DnsServer <String[]>] [-FlowTimeout <Int32>] [-Subnet <PSSubnet[]>] [-BgpCommunity <String>]
[-Tag <Hashtable>] [-EnableDdosProtection] [-DdosProtectionPlanId <String>] [-IpAllocation <PSIpAllocation[]>]
[-Force] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
Expand Down
97 changes: 82 additions & 15 deletions src/Network/Network/help/Set-AzVirtualNetworkGateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,25 +360,92 @@ The fifth command set this new created PSVirtualNetworkGatewayNatRule to NatRule

### Example 7: Delete multiple expired VpnClientRootCertificates of an existing virtual network gateway
```
PS C:\>$Gateway=Get-Azvirtualnetworkgateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"

PS C:\>$rootCerts=$Gateway.VpnClientConfiguration.VpnClientRootCertificates

PS C:\>$rootCerts.Count
PS C:\>$rootCerts[0]
PS C:\>$rootCerts[1]
PS C:\>$rootCerts.Remove($rootCerts[1])

PS C:\>$Gateway1 = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientRootCertificates $rootCerts
PS C:\>$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
PS C:\>$vngNatRules = $Gateway.NatRules
PS C:\>$natRule = New-AzVirtualNetworkGatewayNatRule -Name "natRule1" -Type "Static" -Mode "IngressSnat" -InternalMapping @("25.0.0.0/16") -ExternalMapping @("30.0.0.0/16")
PS C:\>$vngNatRules.Add($natrule)
PS C:\>Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -NatRule $vngNatRules.NatRules -BgpRouteTranslationForNat $true

Name : Gateway001
ResourceGroupName : ResourceGroup001
Location : westcentralus
Id : /subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag : W/"a08f13d3-6106-44e0-9127-e35e6f9793d5"
ResourceGuid : 30993429-a1ed-42ca-9862-9156b013626e
ProvisioningState : Succeeded
Tags :
IpConfigurations : [
{
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/newApipaNet/subnets/GatewaySubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/newapipaip"
},
"Name": "default",
"Etag": "W/\"a08f13d3-6106-44e0-9127-e35e6f9793d5\"",
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default"
}
]
GatewayType : Vpn
VpnType : RouteBased
EnableBgp : False
ActiveActive : False
GatewayDefaultSite : null
Sku : {
"Capacity": 2,
"Name": "VpnGw1",
"Tier": "VpnGw1"
}
VpnClientConfiguration : null
BgpSettings : {
"Asn": 65515,
"BgpPeeringAddress": "10.1.255.30",
"PeerWeight": 0,
"BgpPeeringAddresses": [
{
"IpconfigurationId": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default",
"DefaultBgpIpAddresses": [
"10.1.255.30"
],
"CustomBgpIpAddresses": [
"169.254.21.55"
],
"TunnelIpAddresses": [
"13.78.146.151"
]
}
]
}
NatRules : [
{
"VirtualNetworkGatewayNatRulePropertiesType": "Static",
"Mode": "IngressSnat",
"InternalMappings": [
{
"AddressSpace": "25.0.0.0/16"
}
],
"ExternalMappings": [
{
"AddressSpace": "30.0.0.0/16"
}
],
"ProvisioningState": "Succeeded",
"Name": "natRule1",
"Etag": "W/\"5150d788-e165-42ba-99c4-8138a545fce9\"",
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/natRules/natRule1"
}
]
EnableBgpRouteTranslationForNat : True
```

The first command gets a virtual network gateway named Gateway01 that belongs to resource group ResourceGroup001 and stores it to the variable named $Gateway
The second command gets all the root certificates on VirtualNetworkGateway and save it to another variable $rootCerts
The third command shows total existing root certs on VirtualNetworkGateway.
The forth & fifth commands print root certificates at those corresponding indices for customer to see which ones they want to delete.
The sixth command removes expired root certificate by using that index e.g. here 1. Repeat same steps to remove multiple expired certificates from variable: $rootCerts
The seventh command updates VirtualNetworkGateway to set valid root certificates i.e. certificates that exists in variable: $rootCerts
The second command assigns the existing natrules into variable vngNatRules.
The third command assigns the value newly created PSVirtualNeyworkGatewayNatRule object natrule into variable natRule.
The fourth command add this PSVirtualNeyworkGatewayNatRule object into vngNatRules list.
The fifth command set this new created PSVirtualNetworkGatewayNatRule to NatRules of gateway and update the gateway.

## PARAMETERS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="47.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.5.0" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.3.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="4.1.6-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="4.1.6-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="47.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.5.0" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices" Version="4.3.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="4.1.6-preview" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.Backup" Version="4.1.6-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.3.0" />
<PackageReference Include="Microsoft.Azure.Management.RecoveryServices.SiteRecovery" Version="2.1.4-preview" />
</ItemGroup>
Expand Down