Skip to content

Commit 5a7e570

Browse files
Nilambarianton-evseev
authored andcommitted
Making changes as per commandlet review
1 parent b8cacbe commit 5a7e570

File tree

6 files changed

+51
-51
lines changed

6 files changed

+51
-51
lines changed

src/Network/Network.Test/ScenarioTests/VirtualNetworkGatewayTests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ function Test-VirtualNetworkGatewayOpenVPNAADAuth
727727
$vnetIpConfig = New-AzVirtualNetworkGatewayIpConfig -Name $vnetGatewayConfigName -PublicIpAddress $publicip -Subnet $subnet
728728

729729
# Create & Get P2S OpenVPN AAD authentication on virtualnetworkgateway
730-
New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType Vpn -VpnType RouteBased -VpnClientProtocol OpenVPN -EnableBgp $false -GatewaySku VpnGw1 -VpnClientAddressPool 201.169.0.0/16 #-AadTenant $aadTenant -AadIssuer $aadIssuer -AadAudience $aadAudience
730+
New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType Vpn -VpnType RouteBased -VpnClientProtocol OpenVPN -EnableBgp $false -GatewaySku VpnGw1 -VpnClientAddressPool 201.169.0.0/16 #-AadTenantUri $aadTenant -AadIssuerUri $aadIssuer -AadAudienceId $aadAudience
731731
$actual = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname
732732
$protocols = $actual.VpnClientConfiguration.VpnClientProtocols
733733
Assert-AreEqual 1 @($protocols).Count
@@ -738,7 +738,7 @@ function Test-VirtualNetworkGatewayOpenVPNAADAuth
738738
#Assert-AreEqual $aadAudience $actual.VpnClientConfiguration.AadAudience
739739

740740
# Set an existing virtualnetworkgateway with updated AAD authentication configuration.
741-
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $actual -AadTenant $aadTenant -AadIssuer $aadIssuer -AadAudience $aadAudienceNew
741+
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $actual -AadTenantUri $aadTenant -AadIssuerUri $aadIssuer -AadAudienceId $aadAudienceNew
742742
$actual = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname
743743

744744
Assert-AreEqual "VpnGw1" $actual.Sku.Tier

src/Network/Network/ChangeLog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
- Added methods AddPublicIpAddress and RemovePublicIpAddress on firewall object - these accept a Public IP Address object as input
6060
- Deprecated parameters -PublicIpName and -VirtualNetworkName
6161
* Updated below commands for feature: Set VpnClient AAD authentication options to Virtual network gateway resource.
62-
- Updated New-AzVirtualNetworkGateway: Added optional parameters AadTenant,AadAudience,AadIssuer to set VpnClient AAD authentication options on Gateway.
63-
- Updated Set-AzVirtualNetworkGateway: Added optional parameter AadTenant,AadAudience,AadIssuer to set VpnClient AAD authentication options on Gateway.
62+
- Updated New-AzVirtualNetworkGateway: Added optional parameters AadTenantUri,AadAudienceId,AadIssuerUri to set VpnClient AAD authentication options on Gateway.
63+
- Updated Set-AzVirtualNetworkGateway: Added optional parameter AadTenantUri,AadAudienceId,AadIssuerUri to set VpnClient AAD authentication options on Gateway.
6464
- Updated Set-AzVirtualNetworkGateway: Added optional switch parameter RemoveAadAuthentication to remove VpnClient AAD authentication options from Gateway.
6565

6666
## Version 1.8.1

src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -233,25 +233,25 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
233233
Mandatory = true,
234234
ValueFromPipelineByPropertyName = true,
235235
ParameterSetName = VirtualNetworkGatewayParameterSets.AadAuthenticationConfiguration,
236-
HelpMessage = "P2S AAD authentication option:AADTenant.")]
236+
HelpMessage = "P2S AAD authentication option:AadTenantUri.")]
237237
[ValidateNotNullOrEmpty]
238-
public string AadTenant { get; set; }
238+
public string AadTenantUri { get; set; }
239239

240240
[Parameter(
241241
Mandatory = true,
242242
ValueFromPipelineByPropertyName = true,
243243
ParameterSetName = VirtualNetworkGatewayParameterSets.AadAuthenticationConfiguration,
244-
HelpMessage = "P2S AAD authentication option:AADAudience.")]
244+
HelpMessage = "P2S AAD authentication option:AadAudienceId.")]
245245
[ValidateNotNullOrEmpty]
246-
public string AadAudience { get; set; }
246+
public string AadAudienceId { get; set; }
247247

248248
[Parameter(
249249
Mandatory = true,
250250
ValueFromPipelineByPropertyName = true,
251251
ParameterSetName = VirtualNetworkGatewayParameterSets.AadAuthenticationConfiguration,
252-
HelpMessage = "P2S AAD authentication option:AADIssuer.")]
252+
HelpMessage = "P2S AAD authentication option:AadIssuerUri.")]
253253
[ValidateNotNullOrEmpty]
254-
public string AadIssuer { get; set; }
254+
public string AadIssuerUri { get; set; }
255255

256256
[Parameter(
257257
Mandatory = false,
@@ -359,7 +359,7 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
359359
this.VpnClientRevokedCertificates != null ||
360360
this.RadiusServerAddress != null ||
361361
(this.VpnClientIpsecPolicy != null && this.VpnClientIpsecPolicy.Length != 0) ||
362-
this.AadTenant != null)
362+
this.AadTenantUri != null)
363363
{
364364
vnetGateway.VpnClientConfiguration = new PSVpnClientConfiguration();
365365

@@ -407,19 +407,19 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
407407
vnetGateway.VpnClientConfiguration.RadiusServerSecret = SecureStringExtensions.ConvertToString(this.RadiusServerSecret);
408408
}
409409

410-
if (this.AadTenant != null)
410+
if (this.AadTenantUri != null)
411411
{
412-
if (this.AadIssuer == null || this.AadAudience == null)
412+
if (this.AadIssuerUri == null || this.AadAudienceId == null)
413413
{
414-
throw new ArgumentException("AadTenant, AadIssuer and AadAudience must be specified if AAD authentication is being configured for P2S.");
414+
throw new ArgumentException("AadTenantUri, AadIssuerUri and AadAudienceId must be specified if AAD authentication is being configured for P2S.");
415415
}
416416

417417
if (vnetGateway.VpnClientConfiguration.VpnClientProtocols.Count() == 1 &&
418418
vnetGateway.VpnClientConfiguration.VpnClientProtocols.First().Equals(MNM.VpnClientProtocol.OpenVPN))
419419
{
420-
vnetGateway.VpnClientConfiguration.AadTenant = this.AadTenant;
421-
vnetGateway.VpnClientConfiguration.AadIssuer = this.AadIssuer;
422-
vnetGateway.VpnClientConfiguration.AadAudience = this.AadAudience;
420+
vnetGateway.VpnClientConfiguration.AadTenant = this.AadTenantUri;
421+
vnetGateway.VpnClientConfiguration.AadIssuer = this.AadIssuerUri;
422+
vnetGateway.VpnClientConfiguration.AadAudience = this.AadAudienceId;
423423
}
424424
else
425425
{

src/Network/Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,25 +152,25 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
152152
Mandatory = true,
153153
ValueFromPipelineByPropertyName = true,
154154
ParameterSetName = VirtualNetworkGatewayParameterSets.AadAuthenticationConfiguration,
155-
HelpMessage = "P2S AAD authentication option:AADTenant.")]
155+
HelpMessage = "P2S AAD authentication option:AadTenantUri.")]
156156
[ValidateNotNullOrEmpty]
157-
public string AadTenant { get; set; }
157+
public string AadTenantUri { get; set; }
158158

159159
[Parameter(
160160
Mandatory = true,
161161
ValueFromPipelineByPropertyName = true,
162162
ParameterSetName = VirtualNetworkGatewayParameterSets.AadAuthenticationConfiguration,
163-
HelpMessage = "P2S AAD authentication option:AADAudience.")]
163+
HelpMessage = "P2S AAD authentication option:AadAudienceId.")]
164164
[ValidateNotNullOrEmpty]
165-
public string AadAudience { get; set; }
165+
public string AadAudienceId { get; set; }
166166

167167
[Parameter(
168168
Mandatory = true,
169169
ValueFromPipelineByPropertyName = true,
170170
ParameterSetName = VirtualNetworkGatewayParameterSets.AadAuthenticationConfiguration,
171-
HelpMessage = "P2S AAD authentication option:AADIssuer.")]
171+
HelpMessage = "P2S AAD authentication option:AadIssuerUri.")]
172172
[ValidateNotNullOrEmpty]
173-
public string AadIssuer { get; set; }
173+
public string AadIssuerUri { get; set; }
174174

175175
[Parameter(
176176
Mandatory = false,
@@ -246,7 +246,7 @@ public override void Execute()
246246
this.RadiusServerAddress != null ||
247247
this.RadiusServerSecret != null ||
248248
(this.VpnClientIpsecPolicy != null && this.VpnClientIpsecPolicy.Length != 0) ||
249-
this.AadTenant != null) &&
249+
this.AadTenantUri != null) &&
250250
this.VirtualNetworkGateway.VpnClientConfiguration == null)
251251
{
252252
this.VirtualNetworkGateway.VpnClientConfiguration = new PSVpnClientConfiguration();
@@ -291,17 +291,17 @@ public override void Execute()
291291

292292
if (ParameterSetName.Contains(VirtualNetworkGatewayParameterSets.AadAuthenticationConfiguration))
293293
{
294-
if (this.AadTenant == null || this.AadIssuer == null || this.AadAudience == null)
294+
if (this.AadTenantUri == null || this.AadIssuerUri == null || this.AadAudienceId == null)
295295
{
296-
throw new ArgumentException("AadTenant, AadIssuer and AadAudience must be specified if AAD authentication is being configured for P2S.");
296+
throw new ArgumentException("AadTenantUri, AadIssuerUri and AadAudienceId must be specified if AAD authentication is being configured for P2S.");
297297
}
298298

299299
if (this.VirtualNetworkGateway.VpnClientConfiguration.VpnClientProtocols.Count() == 1 &&
300300
this.VirtualNetworkGateway.VpnClientConfiguration.VpnClientProtocols.First().Equals(MNM.VpnClientProtocol.OpenVPN))
301301
{
302-
this.VirtualNetworkGateway.VpnClientConfiguration.AadTenant = this.AadTenant;
303-
this.VirtualNetworkGateway.VpnClientConfiguration.AadIssuer = this.AadIssuer;
304-
this.VirtualNetworkGateway.VpnClientConfiguration.AadAudience = this.AadAudience;
302+
this.VirtualNetworkGateway.VpnClientConfiguration.AadTenant = this.AadTenantUri;
303+
this.VirtualNetworkGateway.VpnClientConfiguration.AadIssuer = this.AadIssuerUri;
304+
this.VirtualNetworkGateway.VpnClientConfiguration.AadAudience = this.AadAudienceId;
305305
}
306306
else
307307
{

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ New-AzVirtualNetworkGateway -Name <String> -ResourceGroupName <String> -Location
4646
[-GatewayDefaultSite <PSLocalNetworkGateway>] [-VpnClientAddressPool <String[]>]
4747
[-VpnClientProtocol <String[]>] [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
4848
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
49-
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] -AadTenant <String> -AadAudience <String>
50-
-AadIssuer <String> [-CustomRoute <String[]>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
49+
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] -AadTenantUri <String> -AadAudienceId <String>
50+
-AadIssuerUri <String> [-CustomRoute <String[]>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
5151
[-Confirm] [<CommonParameters>]
5252
```
5353

@@ -131,17 +131,17 @@ $subnet = Get-AzVirtualNetworkSubnetConfig -name 'gatewaysubnet' -VirtualNetwork
131131
$ngwipconfig = New-AzVirtualNetworkGatewayIpConfig -Name ngwipconfig -SubnetId $subnet.Id -PublicIpAddressId $ngwpip.Id
132132
$Secure_String_Pwd = ConvertTo-SecureString "TestRadiusServerPassword" -AsPlainText -Force
133133
134-
New-AzVirtualNetworkGateway -Name myNGW -ResourceGroupName vnet-gateway -Location "UK West" -IpConfigurations $ngwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "VpnGw1" -VpnClientProtocol OpenVPN -VpnClientAddressPool 201.169.0.0/16 -AadTenant "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4" -AadIssuer "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/" -AadAudience "a21fce82-76af-45e6-8583-a08cb3b956f9"
134+
New-AzVirtualNetworkGateway -Name myNGW -ResourceGroupName vnet-gateway -Location "UK West" -IpConfigurations $ngwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "VpnGw1" -VpnClientProtocol OpenVPN -VpnClientAddressPool 201.169.0.0/16 -AadTenantUri "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4" -AadIssuerUri "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/" -AadAudienceId "a21fce82-76af-45e6-8583-a08cb3b956f9"
135135
```
136136

137137
The above will create a resource group, request a Public IP Address, create a Virtual Network and
138138
subnet and create a Virtual Network Gateway in Azure.
139-
The gateway will be called "myNGW" within the resource group "vnet-gateway" in the location "UK West" with the previously created IP configurations saved in the variable "ngwIPConfig," the gateway type of "VPN," the vpn type "RouteBased," and the sku "Basic." It also configures AAD authentication configurations: AADTenant, AADIssuer and AADAudience for Vpnclient of virtual network gateway.
139+
The gateway will be called "myNGW" within the resource group "vnet-gateway" in the location "UK West" with the previously created IP configurations saved in the variable "ngwIPConfig," the gateway type of "VPN," the vpn type "RouteBased," and the sku "Basic." It also configures AAD authentication configurations: AadTenantUri, AadIssuerUri and AadAudienceId for Vpnclient of virtual network gateway.
140140

141141
## PARAMETERS
142142

143-
### -AadAudience
144-
P2S AAD authentication option:AADAudience.
143+
### -AadAudienceId
144+
P2S AAD authentication option:AadAudienceId.
145145

146146
```yaml
147147
Type: System.String
@@ -155,8 +155,8 @@ Accept pipeline input: True (ByPropertyName)
155155
Accept wildcard characters: False
156156
```
157157
158-
### -AadIssuer
159-
P2S AAD authentication option:AADIssuer.
158+
### -AadIssuerUri
159+
P2S AAD authentication option:AadIssuerUri.
160160
161161
```yaml
162162
Type: System.String
@@ -170,8 +170,8 @@ Accept pipeline input: True (ByPropertyName)
170170
Accept wildcard characters: False
171171
```
172172
173-
### -AadTenant
174-
P2S AAD authentication option:AADTenant.
173+
### -AadTenantUri
174+
P2S AAD authentication option:AadTenantUri.
175175
176176
```yaml
177177
Type: System.String

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Set-AzVirtualNetworkGateway -VirtualNetworkGateway <PSVirtualNetworkGateway> [-G
5555
[-VpnClientProtocol <String[]>] [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
5656
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
5757
[-Asn <UInt32>] [-PeerWeight <Int32>] [-EnableActiveActiveFeature] [-DisableActiveActiveFeature]
58-
-AadTenant <String> -AadAudience <String> -AadIssuer <String> [-RemoveAadAuthentication]
58+
-AadTenantUri <String> -AadAudienceId <String> -AadIssuerUri <String> [-RemoveAadAuthentication]
5959
[-CustomRoute <String[]>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
6060
[<CommonParameters>]
6161
```
@@ -154,7 +154,7 @@ The second command updates the virtual network gateway Gateway01 with the tags @
154154
### Example 4: Add/Update AAD authentication configuration for VpnClient of an existing virtual network gateway
155155
```
156156
PS C:\>$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
157-
PS C:\>Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -AadTenant "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4" -AadIssuer "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/" -AadAudience "a21fce82-76af-45e6-8583-a08cb3b956f9"
157+
PS C:\>Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -AadTenantUri "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4" -AadIssuerUri "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/" -AadAudienceId "a21fce82-76af-45e6-8583-a08cb3b956f9"
158158
159159
Name : Gateway001
160160
ResourceGroupName : ResourceGroup001
@@ -208,9 +208,9 @@ vpnClientConfiguration : {
208208
209209
"radiusServerAddress": "",
210210
"radiusServerSecret": "",
211-
"aadTenant": "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4\",
212-
"aadAudience": "a21fce82-76af-45e6-8583-a08cb3b956g9\",
213-
"aadIssuer": "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/\"
211+
"aadTenantUri": "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4\",
212+
"aadAudienceId": "a21fce82-76af-45e6-8583-a08cb3b956g9\",
213+
"aadIssuerUri": "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/\"
214214
},
215215
BgpSettings : {
216216
"Asn": 65515,
@@ -222,13 +222,13 @@ PS C:\>Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientRoo
222222
```
223223

224224
The first command gets a virtual network gateway named Gateway01 that belongs to resource group ResourceGroup001 and stores it to the variable named $Gateway
225-
The second command updates the virtual network gateway Gateway01 with the AAD authentication configurations params:aadTenant, aadAudience, aadIssuer for VpnClient.
225+
The second command updates the virtual network gateway Gateway01 with the AAD authentication configurations params:aadTenantUri, aadAudienceId, aadIssuerUri for VpnClient.
226226
The third command removes the AAD authentication configuration from VpnClient of virtual network gateway.
227227

228228
## PARAMETERS
229229

230-
### -AadAudience
231-
P2S AAD authentication option:AADAudience.
230+
### -AadAudienceId
231+
P2S AAD authentication option:AadAudienceId.
232232

233233
```yaml
234234
Type: System.String
@@ -242,8 +242,8 @@ Accept pipeline input: True (ByPropertyName)
242242
Accept wildcard characters: False
243243
```
244244
245-
### -AadIssuer
246-
P2S AAD authentication option:AADIssuer.
245+
### -AadIssuerUri
246+
P2S AAD authentication option:AadIssuerUri.
247247
248248
```yaml
249249
Type: System.String
@@ -257,8 +257,8 @@ Accept pipeline input: True (ByPropertyName)
257257
Accept wildcard characters: False
258258
```
259259
260-
### -AadTenant
261-
P2S AAD authentication option:AADTenant.
260+
### -AadTenantUri
261+
P2S AAD authentication option:AadTenantUri.
262262
263263
```yaml
264264
Type: System.String

0 commit comments

Comments
 (0)