Skip to content

Commit 0bd0f56

Browse files
authored
Update ExtendedLocation validation in NewAzureVirtualNetworkGateway (#21910)
* Fixed NewVNG ExtendedLocation validation * More fix * Avoid breaking
1 parent 3eef8a8 commit 0bd0f56

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Updated `New-AzVirtualNetworkGateway` to remove validation for `ExtendedLocation` parameter
2223

2324
## Version 6.0.0
2425
* Added new cmdlets for RouteMap child resource of VirtualHub.

src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
8181
Mandatory = false,
8282
ValueFromPipelineByPropertyName = true,
8383
HelpMessage = "The extended location of this virtual network gateway")]
84-
[ValidateSet(
85-
"MicrosoftRRDCLab3",
86-
IgnoreCase = true)]
8784
public string ExtendedLocation { get; set; }
8885

8986
[Parameter(
@@ -409,7 +406,7 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
409406

410407
}
411408
vnetGateway.GatewayType = this.GatewayType;
412-
if(vnetGateway.GatewayType == "LocalGateway")
409+
if (vnetGateway.GatewayType == "LocalGateway" || vnetGateway.GatewayType == "ExpressRoute")
413410
{
414411
vnetGateway.ExtendedLocation = new PSExtendedLocation(this.ExtendedLocation);
415412
vnetGateway.VNetExtendedLocationResourceId = this.VNetExtendedLocationResourceId;

src/Network/Network/help/New-AzVirtualNetworkGateway.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ The extended location of this virtual network gateway
388388
Type: System.String
389389
Parameter Sets: (All)
390390
Aliases:
391-
Accepted values: MicrosoftRRDCLab3
392391

393392
Required: False
394393
Position: Named

0 commit comments

Comments
 (0)