Skip to content

Commit

Permalink
Virtual Network Gateway Commandlets Update for BgpSettings (#11424)
Browse files Browse the repository at this point in the history
* Update ChangeLog.md

* Correct version for changelog.md

* Polish content for changelog.md

* Add network release

* For RC2 build

* ps-vsprompt

* removed ps-vsprompt from PR

* add comma

* change dogfood endpoint in session records

* add servers back into vulnerability

* BugFix for PrivateLinkServiceConnectionState

* Added three required assemblies for the AzAttestation PowerShell cmdlets.  (Microsoft.IdentityModel.*)

* ltr policy record

* Updated ChangeLog.md

* re-recorded backup tests

* update virtualhub cmdlets also

* add resource types

* comment edits

* Get-AzGalleryImageVersion fix example args

Update samples to use proper argument  -GalleryImageDefinitionName not -ImageDefinitionName

* for RC2 release

* update changelog

* updated changelog

* updated changelog for upcoming release

* Fix typo

infomation→information

* PR comments has been resolved

* Updated help content

* Display ResourceManager correlationIds in error output

* close ticket function.

* For final RC

* For final RC

* Adding SensitivityRank parameter to DataClassification Set Cmdlets

* typo, unused imports. - enable severity, status tests. update properties count( since prod outage was removed). add tests for ticket status.

* properties count to 5

* count for prob class to 5

* fix get-azresource -ResourceGroupName -Name -ResourceType to use correct ApiVersion

* Complete cmdlet implementations

* fix get-azresource -ResourceGroupName -Name -ExpandProperties -ResourceType to use correct ApiVersion

* Fix Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.dll.json

#10826

* Fix changelog merge issue

* remove override DefaultContext

* Restore-AzSqlInstanceDatabase - fix "an" -> "a"

Examples: fix "an deleted instance" to "a deleted instance"

* Add changelog entry

* chore) update privacy notice text

* Update changelog.md per contributing.md

* chore) minor text correction

* Improve PolicyInsights error messages

* Address reviwer comments

* Add note about the version of PowerShell

* fix changelog merge error

* Minor helper file fix

* update macos to 10.14

* Add DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs file itself.

* Add DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs file itself.

* disable one test case that is unstable on linux

* remove file

* add DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs

* Create DisableAzureSqlServerActiveDirectoryOnlyAuthentication.cs

* Update ChangeLog.md

add cmdlet Disable-AzSqlServerActiveDirectoryOnlyAuthentication

* Update ChangeLog.md

* SAP AEM: add support for the new VM Extension for SAP

* Update ChangeLog.md

remove edit to this file

* Update ChangeLog.md

* Add cmdlet Disable-AzSqlServerActiveDirectoryOnlyAuthentication to upcoming section.

* Fixing the parameter name IsAzureADOnlyAuthentication and documentation

* reprotect and Update bug fixes

* add an alias to avoid breaking change

* Update the azure powershell developer guide with autorest powershell generator related materials

* Update the category.

* change log

* Update syntax in help files.

* Update C# SDK to throw Cloud Exception, Update default SKU to be ST2

* Escape single quote

* add TestGetResourceByNameAndType test for apiversion check

* updating tests and adding completer

* fix changelog merge error

* updating help files and tests

* add breaking changes

* Update files

* Update encoding to UTF8

* Add breaking changes (#11329)

* add breaking changes

* Change useragent to align to Az3.0 modules

* Update Get-AzResourceLock.md

Added an example that uses the -AtScope parameter.

* Update ChangeLog.md

* Consume modified SDK clients.

* Remove unnecessary changes.

* Fix doc

Microsot→Microsoft
add dot

* Add a test case for Save-AzDeploymentScript cmdlet; update test recordings; update help messages; address reviewer comments

* Remove duplicate cmdlet names in Az.Resources.psd1

* Add change log comment

* Update Network SDK & test recordings

* add license header to ArrayExtension.cs

* Updated error messages and help files.
- Share service provided details for 4xx HTTP status codes
- Updated help file examples to be accurate and consistent

* Update tests, tests records and help files.

* Update New-AzVmss for AutomaticRepairsPolicy issue.

* Update Compute SDK version to 33.0.0

* Updated CosmosDB Management version

* Updated TEE type name VSMEnclave to VBSEnclave

* Updated ChangeLog

* Removed the new version header from ChangeLog

* Added option of Byte encoding for New-AzDataLakeStoreItem, Add-AzDAtaLakeStoreItemContent, Get-AzDAtaLakeStoreItemContent

* Update URLs in help files

* AppGw recordings

* Updated CosmosDB Management SDK version (#11351)

* Updated CosmosDB Management version

* Updated ChangeLog

* Removed the new version header from ChangeLog

Co-authored-by: Meha Kaushik <mekaushi@microsoft.com>

* [ASR] [V2A] Adding properties for VMware DR monitoring

* Update

* bump up version

* Fix the bug that RunVerioncontroller.ps1 act different under different directory.

* CredSan suppression

* Update tests file.

* Adding SensitivityRank parameter to DataClassification Set Cmdlets

* Update syntax in help files.

* Consume modified SDK clients.

* Remove unnecessary changes.

* Update tests, tests records and help files.

* Update tests file.

* Update ChangeLog.md

* Update Management.Sql package version

* Add rerun support to create pipeline run cmdlet

* Update changeLog

* Fix

* addressing review comments

* ChangeLog update

* add comment, add byte encoding for auto completion

* 1.Support customers specify min TLS version when creating cluster
2. Update New-AzHDInsightConfig.md

* Added retrying policy update

* updated paramsets and added help file

* Fix after merge

* Update README.md

* Fixing bugs and Allowing Gremlin, Cassandra, Table api account creation

* Allow Encryption property to Target parameter of New-AzGalleryImageVersion cmdlet

Add the following parameters to New-AzDiskConfig: DiskIOPSReadOnly, DiskMBpsReadOnly, MaxSharesCount, GalleryImageReference
Fix tempDisk issue

* suppress breaking change issue from int to long

* Replace Sql client using generic rest client

* Update change log

* Fixing Cassandra schema and Mongo shard key null values

* Adding in ChangeLog

* Updated Help

* Revise according to review

* Adding chnage1

* Commit1

* adding command

* fix

* Final Commit

* Adding Test Scenarios

* Updating changelog

* updating changelog1

* FixingNewGatewayCmd

* Adding Tests for NewGateway

* Fixing helpmd

* Adding helpfile

* fixing md file

* Fixing helpmd

* Adding chnage1

* Commit1

* adding command

* fix

* Final Commit

* Adding Test Scenarios

* Updating changelog

* updating changelog1

* FixingNewGatewayCmd

* Adding Tests for NewGateway

* Fixing helpmd

* Adding helpfile

* Fixing helpmd

Co-authored-by: Dingmeng Xue <56333063+dingmeng-xue@users.noreply.github.com>
Co-authored-by: dixue@microsoft.com <dixue@microsoft.com>
Co-authored-by: Yunchi Wang <54880216+wyunchi-ms@users.noreply.github.com>
Co-authored-by: xaliciayang <59986952+xaliciayang@users.noreply.github.com>
Co-authored-by: xaliciayang <ayang@microsoft.com>
Co-authored-by: Bo Wen <bowen@microsoft.com>
Co-authored-by: gkostal <gkostal@microsoft.com>
Co-authored-by: Ritvika Nagula <rinagula@microsoft.com>
Co-authored-by: Yabo Hu <yabhu@microsoft.com>
Co-authored-by: aygoya <aygoya@microsoft.com>
Co-authored-by: Bill Sproule <william.sproule@microsoft.com>
Co-authored-by: bashahee <32364196+bashahee@users.noreply.github.com>
Co-authored-by: Yeming Liu <yeliu@microsoft.com>
Co-authored-by: Yeming Liu <Yeming.Liu@microsoft.com>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Sapan Saxena <v-sapsax@microsoft.com>
Co-authored-by: Anthony Martin <antmarti@microsoft.com>
Co-authored-by: bashahee <bashahee@microsoft.com>
Co-authored-by: Jason Gilbertson <jagilber@users.noreply.github.com>
Co-authored-by: Filiz Topatan <lsefitopata@microsoft.com>
Co-authored-by: msJinLei <leijin@microsoft.com>
Co-authored-by: Hans De Mulder <Styxxy@users.noreply.github.com>
Co-authored-by: Sudhindra Kovalam <sukovala@microsoft.com>
Co-authored-by: Chris Eggert <cheggert@microsoft.com>
Co-authored-by: Damien Caro <dcaro@microsoft.com>
Co-authored-by: Nilambari <nilambari.deshpande@hotmail.com>
Co-authored-by: Nilambari <nilamd@microsoft.com>
Co-authored-by: Amol Agarwal <amagarwa@microsoft.com>
Co-authored-by: Amol Agarwal <57109831+amolagar5@users.noreply.github.com>
Co-authored-by: MSSedusch <sedusch@microsoft.com>
Co-authored-by: ayfathim <ayfathim@microsoft.com>
Co-authored-by: Xiaogang Ding <xidi@microsoft.com>
Co-authored-by: Teng Lu <telu@microsoft.com>
Co-authored-by: shahbj79 <shahbj79@hotmail.com>
Co-authored-by: Bhavin Shah <bhshah@microsoft.com>
Co-authored-by: Peter Lorenzen <theheatDK@users.noreply.github.com>
Co-authored-by: erich-wang <eriwan@microsoft.com>
Co-authored-by: Anton Evseev <v-anevse@microsoft.com>
Co-authored-by: Hyonho Lee <Hyonho.Lee@microsoft.com>
Co-authored-by: Meha Kaushik <mekaushi@microsoft.com>
Co-authored-by: Rahul Dutta <rahuldutta90@users.noreply.github.com>
Co-authored-by: Meha Kaushik <kaushik.meha@gmail.com>
Co-authored-by: Vidyadhari Jami <vijami@microsoft.com>
Co-authored-by: wyunchi-ms <wang935863431@126.com>
Co-authored-by: lijzha <lijzha@microsoft.com>
Co-authored-by: Jin Lei <54836179+msJinLei@users.noreply.github.com>
Co-authored-by: Zhenyu Zhou <zhezhou@microsoft.com>
Co-authored-by: sambitratha <es15btech11015@iith.ac.in>
Co-authored-by: Sambit Rath <sarath@microsoft.com>
Co-authored-by: Khushboo Baheti <khbaheti@microsoft.com>
  • Loading branch information
Show file tree
Hide file tree
Showing 16 changed files with 9,773 additions and 9,605 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@ function Test-VirtualNetworkGatewayCRUD

# Create & Get virtualnetworkgateway
$vnetIpConfig = New-AzVirtualNetworkGatewayIpConfig -Name $vnetGatewayConfigName -PublicIpAddress $publicip -Subnet $subnet
$job = New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType Vpn -VpnType RouteBased -EnableBgp $false -AsJob
$ipconfigurationId = $vnetIpConfig.id
$addresslist = @('169.254.21.25')
$gw1ipconfBgp = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId -CustomAddress $addresslist
$job = New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -IpConfigurationBgpPeeringAddresses $gw1ipconfBgp -GatewayType Vpn -VpnType RouteBased -EnableBgp $false -AsJob
$job | Wait-Job
$actual = $job | Receive-Job
$expected = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
Assert-AreEqual $expected.Name $actual.Name
Assert-AreEqual "Vpn" $expected.GatewayType
Assert-AreEqual "RouteBased" $expected.VpnType
Assert-AreEqual 1 @($expected.BgpSettings.BGPPeeringAddresses).Count

# List virtualNetworkGateways
$list = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname
Expand Down Expand Up @@ -281,6 +285,13 @@ function Test-SetVirtualNetworkGatewayCRUD
Assert-AreEqual $asn $gateway.BgpSettings.Asn
Assert-AreEqual $peerWeight $gateway.BgpSettings.PeerWeight

# BGPPeeringAddresses
$ipconfigurationId1 = $gateway.ipconfigurations[0].id
$addresslist1 = @('169.254.21.10')
$gw1ipconfBgp1 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId1 -CustomAddress $addresslist1
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -IpConfigurationBgpPeeringAddresses $gw1ipconfBgp1
Assert-AreEqual $ipconfigurationId1 $gateway.BgpSettings.BGPPeeringAddresses[0].IpConfigurationId

# Tags
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -Tag @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }
Assert-AreEqual 2 $gateway.Tag.Count
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Network/Network/Az.Network.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate',
'Get-AzVirtualRouter', 'Add-AzVirtualRouterPeer',
'Update-AzVirtualRouterPeer', 'Remove-AzVirtualRouterPeer',
'Get-AzVirtualRouterPeer', 'New-AzIpGroup', 'Remove-AzIpGroup',
'Get-AzIpGroup', 'Set-AzIpGroup'
'Get-AzIpGroup', 'Set-AzIpGroup',
'New-AzIpConfigurationBgpPeeringAddressObject'

# Variables to export from this module
# VariablesToExport = @()
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
- `New-AzVirtualHub`
- `Update-AzVirtualHub`
* Removed Sql Management SDK dependency
* Added 'New-AzIpConfigurationBgpPeeringAddressObject'
* Updated 'Set-AzVirtualNetworkGateway' and 'New-AzVirtualNetworkGateway'

## Version 2.3.2
* Updated Sql Management SDK.
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 @@ -875,6 +875,7 @@ private static void Initialize()
cfg.CreateMap<CNM.PSBGPPeerStatus, MNM.BgpPeerStatus>();
cfg.CreateMap<CNM.PSGatewayRoute, MNM.GatewayRoute>();
cfg.CreateMap<CNM.PSVpnClientConnectionHealthDetail, MNM.VpnClientConnectionHealthDetail>();
cfg.CreateMap<CNM.PSIpConfigurationBgpPeeringAddress, MNM.IPConfigurationBgpPeeringAddress>();

// MNM to CNM
cfg.CreateMap<MNM.VirtualNetworkGateway, CNM.PSVirtualNetworkGateway>();
Expand All @@ -895,6 +896,7 @@ private static void Initialize()
cfg.CreateMap<MNM.BgpPeerStatus, CNM.PSBGPPeerStatus>();
cfg.CreateMap<MNM.GatewayRoute, CNM.PSGatewayRoute>();
cfg.CreateMap<MNM.VpnClientConnectionHealthDetail, CNM.PSVpnClientConnectionHealthDetail>();
cfg.CreateMap<MNM.IPConfigurationBgpPeeringAddress, CNM.PSIpConfigurationBgpPeeringAddress>();

// Application Gateways
// CNM to MNM
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Network/Generated/Models/PSBgpSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
using Microsoft.Azure.Management.Network.Models;
using Microsoft.WindowsAzure.Commands.Common.Attributes;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Network.Models
{
Expand All @@ -38,5 +39,6 @@ public partial class PSBgpSettings
public string BgpPeeringAddress { get; set; }
[Ps1Xml(Target = ViewControl.Table)]
public int? PeerWeight { get; set; }
public List<PSIpConfigurationBgpPeeringAddress> BgpPeeringAddresses { get; set; }
}
}
30 changes: 30 additions & 0 deletions src/Network/Network/Models/PSIpConfigurationBgpPeeringAddress.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// ----------------------------------------------------------------------------------
//
// 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 System.Collections.Generic;

namespace Microsoft.Azure.Commands.Network.Models
{
public class PSIpConfigurationBgpPeeringAddress : PSChildResource
{
public string IpconfigurationId;

public List<string> DefaultBgpIpAddresses;

public List<string> CustomBgpIpAddresses;

public List<string> TunnelIpAddresses;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static string GetResourceNotSetId(string subscriptionId, string resource,
resourceName);
}

private static string NormalizeVirtualNetworkGatewayChildResourceIds(string id, string resourceGroupName, string VirtualNetworkGatewayName)
public static string NormalizeVirtualNetworkGatewayChildResourceIds(string id, string resourceGroupName, string VirtualNetworkGatewayName)
{
id = NormalizeId(id, "resourceGroups", resourceGroupName);
id = NormalizeId(id, "virtualNetworkGateways", VirtualNetworkGatewayName);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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.Azure.Management.Network.Models;
using System;
using System.Collections.Generic;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Network.VirtualNetworkGateway
{
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IpConfigurationBgpPeeringAddressObject",
DefaultParameterSetName = "ByName", SupportsShouldProcess = true), OutputType(typeof(PSIpConfigurationBgpPeeringAddress))]

public class NewAzIpConfigurationBgpPeeringAddressObjectCommand : VirtualNetworkGatewayBaseCmdlet
{
[Parameter(
ParameterSetName = "ByName",
Mandatory = true,
HelpMessage = "The virtual network gateway IpConfigurationId for BgpPeeringAddresses.")]
[ValidateNotNullOrEmpty]
public string IpConfigurationId { get; set; }

[Parameter(
ParameterSetName = "ByName",
Mandatory = true,
HelpMessage = "The virtual network gateway CustomAddress List for BgpPeeringAddresses.")]
[ValidateNotNullOrEmpty]
public List<string> CustomAddress { get; set; }

public override void Execute()
{
base.Execute();
var output = new PSIpConfigurationBgpPeeringAddress();
output.IpconfigurationId = this.IpConfigurationId;
output.CustomBgpIpAddresses = this.CustomAddress;
WriteObject(output);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
HelpMessage = "The weight added to routes learned over BGP from this virtual network gateway")]
public int PeerWeight { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The BgpPeeringAddresses for Virtual network gateway bgpsettings.")]
[ValidateNotNullOrEmpty]
public PSIpConfigurationBgpPeeringAddress[] IpConfigurationBgpPeeringAddresses { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
Expand Down Expand Up @@ -465,6 +472,26 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
}
}

if (this.IpConfigurationBgpPeeringAddresses != null)
{
if(vnetGateway.BgpSettings == null)
{
vnetGateway.BgpSettings = new PSBgpSettings();
}

vnetGateway.BgpSettings.BgpPeeringAddresses = new List<PSIpConfigurationBgpPeeringAddress>();

foreach (var address in this.IpConfigurationBgpPeeringAddresses)
{
address.IpconfigurationId = FormatIdBgpPeeringAddresses(address.IpconfigurationId, this.ResourceGroupName, this.Name);
vnetGateway.BgpSettings.BgpPeeringAddresses.Add(address);
}
}
else if(vnetGateway.BgpSettings != null)
{
vnetGateway.BgpSettings.BgpPeeringAddresses = null;
}

if (this.CustomRoute != null && this.CustomRoute.Any())
{
vnetGateway.CustomRoutes = new PSAddressSpace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
HelpMessage = "The weight added to routes learned over BGP from this virtual network gateway")]
public int PeerWeight { get; set; }

[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The BgpPeeringAddresses for Virtual network gateway bgpsettings.")]
[ValidateNotNullOrEmpty]
public PSIpConfigurationBgpPeeringAddress[] IpConfigurationBgpPeeringAddresses { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Flag to enable Active Active feature on virtual network gateway")]
Expand Down Expand Up @@ -340,6 +347,44 @@ public override void Execute()
throw new ArgumentException("PeerWeight must be a positive integer");
}

if(this.IpConfigurationBgpPeeringAddresses != null)
{
if(this.VirtualNetworkGateway.BgpSettings == null)
{
this.VirtualNetworkGateway.BgpSettings = new PSBgpSettings();
}

if (this.VirtualNetworkGateway.BgpSettings.BgpPeeringAddresses == null)
{
this.VirtualNetworkGateway.BgpSettings.BgpPeeringAddresses = new List<PSIpConfigurationBgpPeeringAddress>();

foreach (var address in this.IpConfigurationBgpPeeringAddresses)
{
this.VirtualNetworkGateway.BgpSettings.BgpPeeringAddresses.Add(address);
}
}
else
{
foreach (var address in this.IpConfigurationBgpPeeringAddresses)
{
bool isGatewayIpConfigurationExists = this.VirtualNetworkGateway.BgpSettings.BgpPeeringAddresses.Any(
ipconfaddress => ipconfaddress.IpconfigurationId.Equals(address.IpconfigurationId, StringComparison.OrdinalIgnoreCase));

if(isGatewayIpConfigurationExists)
{
var bgpPeeringPropertiesInRequest = this.VirtualNetworkGateway.BgpSettings.BgpPeeringAddresses.FirstOrDefault(
x => x.IpconfigurationId.Equals(address.IpconfigurationId, StringComparison.OrdinalIgnoreCase));

bgpPeeringPropertiesInRequest.CustomBgpIpAddresses = address.CustomBgpIpAddresses;
}
else
{
this.VirtualNetworkGateway.BgpSettings.BgpPeeringAddresses.Add(address);
}
}
}
}

if (this.CustomRoute != null && this.CustomRoute.Any())
{
this.VirtualNetworkGateway.CustomRoutes = new PSAddressSpace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,12 @@ public PSVpnClientIPsecParameters GetVpnClientIpsecParameters(string resourceGro

return psVpnClientIPsecParameters;
}

public string FormatIdBgpPeeringAddresses(string id, string resourceGroupName, string resourceName)
{
string result = ChildResourceHelp.NormalizeVirtualNetworkGatewayChildResourceIds(id, resourceGroupName, resourceName);
result = result.Replace("virtualNetworkGatewayIpConfiguration", "ipConfigurations");
return result;
}
}
}
Loading

0 comments on commit 50aaa7a

Please sign in to comment.