Skip to content
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
1 change: 1 addition & 0 deletions src/Network/Network/Az.Network.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate',
'Remove-AzDdosProtectionPlan',
'New-AzNetworkWatcherProtocolConfiguration',
'Add-AzExpressRouteCircuitConnectionConfig',
'Set-AzExpressRouteCircuitConnectionConfig',
'Get-AzExpressRouteCircuitConnectionConfig',
'Remove-AzExpressRouteCircuitConnectionConfig',
'New-AzServiceEndpointPolicy', 'Remove-AzServiceEndpointPolicy',
Expand Down
15 changes: 15 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
--->

## Upcoming Release
* Add Support for IPv6 in ExpressRouteCircuitConnectionConfig (Global Reach)
- Added Cmdlet
- Set-AzExpressRouteCircuitConnectionConfig
- allows setting of all the existing property including the IPv6CircuitConnectionProperties
-Updated Cmdlet
- Add-AzExpressRouteCircuitConnectionConfig
- Added another optional parameter AddressPrefixType to specify the address family of address prefix
* New example added to Set-AzNetworkWatcherConfigFlowLog.md to demonstrate Traffic Analytics disable scenario.
* Corrected Get-AzNetworkSecurityGroup examples to show examples for NSG's instead of network interfaces.
* Fixed typo in New-AzureRmVpnSite command that was preventing resource id completer from completing a parameter.
* Fixed FilterData example in Start-AzVirtualNetworkGatewayConnectionPacketCapture.md and Start-AzVirtualnetworkGatewayPacketCapture.md.
* Added Packet Capture example for capture all inner and outer packets in Start-AzVirtualNetworkGatewayConnectionPacketCapture.md and Start-AzVirtualnetworkGatewayPacketCapture.md.

## Version 2.2.1
* Upgrade dependancy of Microsoft.Azure.Management.Sql from 1.36-preview to 1.37-preview

## Version 2.2.0
* Update references in .psd1 to use relative path
Expand Down
6 changes: 4 additions & 2 deletions src/Network/Network/Common/NetworkResourceManagerProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ private static void Initialize()
cfg.CreateMap<CNM.PSPeering, MNM.ExpressRouteCircuitPeering>();
cfg.CreateMap<CNM.PSExpressRouteCircuitAuthorization, MNM.ExpressRouteCircuitAuthorization>();
cfg.CreateMap<CNM.PSExpressRouteCircuitConnection, MNM.ExpressRouteCircuitConnection>();
cfg.CreateMap<CNM.PSExpressRouteCircuitConnectionIPv6ConnectionConfig, MNM.Ipv6CircuitConnectionConfig>();

// MNM to CNM
cfg.CreateMap<MNM.ExpressRouteCircuit, CNM.PSExpressRouteCircuit>();
Expand All @@ -759,6 +760,7 @@ private static void Initialize()
cfg.CreateMap<CNM.PSExpressRouteCircuitRoutesTable, MNM.ExpressRouteCircuitRoutesTable>();
cfg.CreateMap<CNM.PSExpressRouteCircuitRoutesTableSummary, MNM.ExpressRouteCircuitRoutesTableSummary>();
cfg.CreateMap<MNM.ExpressRouteCircuitConnection, CNM.PSExpressRouteCircuitConnection>();
cfg.CreateMap<MNM.Ipv6CircuitConnectionConfig, CNM.PSExpressRouteCircuitConnectionIPv6ConnectionConfig>();

// ExpressRouteCircuitPeering
// CNM to MNM
Expand All @@ -774,10 +776,10 @@ private static void Initialize()
// Express Route Circuit Connection
// CNM to MNM
cfg.CreateMap<CNM.PSExpressRouteCircuitConnection, MNM.ExpressRouteCircuitConnection>();

// MNM to CNM
cfg.CreateMap<MNM.ExpressRouteCircuitConnection, CNM.PSExpressRouteCircuitConnection>();

// Peer Express Route Circuit Connection
// CNM to MNM
cfg.CreateMap<CNM.PSPeerExpressRouteCircuitConnection, MNM.PeerExpressRouteCircuitConnection>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public override void Execute()
{
base.Execute();

var circuitconnection = new PSExpressRouteCircuitConnection();

circuitconnection.Name = this.Name;
circuitconnection.AddressPrefix = this.AddressPrefix;

var peering =
this.ExpressRouteCircuit.Peerings.SingleOrDefault(
resource =>
Expand All @@ -58,6 +53,19 @@ public override void Execute()
throw new ArgumentException("Private Peering needs to be configured on the Express Route Circuit");
}

var circuitconnection = peering.Connections.SingleOrDefault(
resource =>
string.Equals(resource.Name, Name, System.StringComparison.CurrentCultureIgnoreCase));

if (circuitconnection != null)
{
throw new ArgumentException(string.Format("Circuit Connection {0} is already added ", Name));
}

circuitconnection = new PSExpressRouteCircuitConnection();

circuitconnection.Name = this.Name;

circuitconnection.ExpressRouteCircuitPeering = new PSResourceId();
circuitconnection.ExpressRouteCircuitPeering.Id = peering.Id;

Expand All @@ -69,6 +77,19 @@ public override void Execute()
circuitconnection.AuthorizationKey = this.AuthorizationKey;
}

if (this.AddressPrefixType == IPv6)
{
// Create new PSExpressRouteIPv6AddressPrefix()
var expressRouteIPv6AddressPrefix = new PSExpressRouteCircuitConnectionIPv6ConnectionConfig();
expressRouteIPv6AddressPrefix.AddressPrefix = AddressPrefix;
circuitconnection.IPv6CircuitConnectionConfig = expressRouteIPv6AddressPrefix;
}
else
{
// For IPv4
circuitconnection.AddressPrefix = this.AddressPrefix;
}

peering.Connections.Add(circuitconnection);

WriteObject(this.ExpressRouteCircuit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ public class AzureExpressRouteCircuitConnectionConfigBase : NetworkBaseCmdlet
[ValidateNotNullOrEmpty]
public string AddressPrefix { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Specify address family of the configured AddressPrefix. Valid values [IPv4|IPv6]")]
[ValidateSet(
IPv4,
IPv6,
IgnoreCase = true)]
public string AddressPrefixType { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Authorization Key to peer to circuit in another subscription")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.Network.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Network {
[CmdletOutputBreakingChange(typeof(PSExpressRouteCircuit), DeprecatedOutputProperties = new[] { "AllowGlobalReach" })]
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ExpressRouteCircuitConnectionConfig", DefaultParameterSetName = "SetByResource", SupportsShouldProcess = true), OutputType(typeof(PSExpressRouteCircuit))]
public class SetAzureExpressRouteCircuitConnectionConfigCommand : AzureExpressRouteCircuitConnectionConfigBase
{
[Parameter(
Position = 0,
Mandatory = true,
HelpMessage = "The name of the Circuit Connection")]
[ValidateNotNullOrEmpty]
public override string Name { get; set; }

[Parameter(
Position = 1,
Mandatory = true,
ValueFromPipeline = true,
HelpMessage = "Express Route Circuit Peering initiating connection")]
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

public override void Execute()
{
base.Execute();

var peering = this.ExpressRouteCircuit.Peerings.SingleOrDefault(
resource =>
string.Equals(resource.Name, "AzurePrivatePeering", System.StringComparison.CurrentCultureIgnoreCase));

if (peering == null)
{
throw new ArgumentException("Private Peering needs to be configured on the Express Route Circuit");
}

var circuitconnection = peering.Connections.SingleOrDefault(
resource =>
string.Equals(resource.Name, Name, StringComparison.CurrentCultureIgnoreCase));

if (null == circuitconnection)
{
throw new ArgumentException(string.Format("Circuit Connection with Name {0} was not added to the private peering", Name));
}

circuitconnection.Name = this.Name;

if (null != peering.Id)
{
circuitconnection.ExpressRouteCircuitPeering.Id = peering.Id;
}

if (null != this.PeerExpressRouteCircuitPeering)
{
circuitconnection.PeerExpressRouteCircuitPeering.Id = this.PeerExpressRouteCircuitPeering;
}

if (!string.IsNullOrWhiteSpace(this.AuthorizationKey))
{
circuitconnection.AuthorizationKey = this.AuthorizationKey;
}

if (this.AddressPrefix != null)
{
if (this.AddressPrefixType == IPv6)
{
if (circuitconnection.IPv6CircuitConnectionConfig != null)
{
circuitconnection.IPv6CircuitConnectionConfig.AddressPrefix = this.AddressPrefix;
}
else
{
var ipv6AddressPrefix = new PSExpressRouteCircuitConnectionIPv6ConnectionConfig();
ipv6AddressPrefix.AddressPrefix = this.AddressPrefix;
circuitconnection.IPv6CircuitConnectionConfig = ipv6AddressPrefix;
}
}
else
{
circuitconnection.AddressPrefix = this.AddressPrefix;
}
}

WriteObject(this.ExpressRouteCircuit);
} // end of Execute()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public partial class PSExpressRouteCircuitConnection : PSChildResource
[JsonProperty(Order = 1)]
public PSResourceId PeerExpressRouteCircuitPeering { get; set; }

[JsonProperty(Order = 1)]
public PSExpressRouteCircuitConnectionIPv6ConnectionConfig IPv6CircuitConnectionConfig { get; set; }

[JsonIgnore]
public string ExpressRouteCircuitPeeringText
{
Expand All @@ -59,5 +62,11 @@ public string PeerExpressRouteCircuitPeeringText
{
get { return JsonConvert.SerializeObject(PeerExpressRouteCircuitPeering, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
}

[JsonIgnore]
public string IPv6CircuitConnectionConfigText
{
get { return JsonConvert.SerializeObject(IPv6CircuitConnectionConfig, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// Copyright (c) Microsoft. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

namespace Microsoft.Azure.Commands.Network.Models
{
using Microsoft.Azure.Management.Network.Models;

using Newtonsoft.Json;
using WindowsAzure.Commands.Common.Attributes;

public class PSExpressRouteCircuitConnectionIPv6ConnectionConfig
{
[JsonProperty(Order = 1)]
[Ps1Xml(Target = ViewControl.Table)]
public string AddressPrefix { get; set; }

[JsonProperty(Order = 1)]
[Ps1Xml(Target = ViewControl.Table)]
public string CircuitConnectionStatus { get; set; }

}
}
4 changes: 3 additions & 1 deletion src/Network/Network/Network.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>Network</PsModuleName>
Expand All @@ -8,6 +8,8 @@

<PropertyGroup>
<RootNamespace>$(LegacyAssemblyPrefix)$(PsModuleName)</RootNamespace>
<ApplicationIcon />
<Win32Resource />
</PropertyGroup>

<ItemGroup>
Expand Down
26 changes: 26 additions & 0 deletions src/Network/Network/Network.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -2889,6 +2889,32 @@
<Label>PeerExpressRouteCircuitPeering</Label>
<PropertyName>PeerExpressRouteCircuitPeering</PropertyName>
</ListItem>
<ListItem>
<Label>IPv6CircuitConnectionConfig</Label>
<PropertyName>IPv6CircuitConnectionConfigText</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
<View>
<Name>Microsoft.Azure.Commands.Network.Models.PSExpressRouteCircuitConnectionIPv6Prefix</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.Commands.Network.Models.PSExpressRouteCircuitConnectionIPv6Prefix</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<Label>AddressPrefix</Label>
<PropertyName>AddressPrefix</PropertyName>
</ListItem>
<ListItem>
<Label>CircuitConnectionStatus</Label>
<PropertyName>CircuitConnectionStatus</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
Expand Down
Loading