Skip to content

Commit 9eeba5b

Browse files
grajat341Rajat Gupta
andauthored
Added Dedicated backend connection and certificate validation options in template for application Gateway Backend Settings (#28000)
Co-authored-by: Rajat Gupta <[email protected]>
1 parent ffedcad commit 9eeba5b

File tree

6 files changed

+255
-0
lines changed

6 files changed

+255
-0
lines changed

src/Network/Network/ApplicationGateway/BackendHttpSettings/AzureApplicationGatewayBackendHttpSettingsBase.cs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,27 @@ public class AzureApplicationGatewayBackendHttpSettingsBase : NetworkBaseCmdlet
106106
[ValidateNotNullOrEmpty]
107107
public string Path { get; set; }
108108

109+
[Parameter(
110+
Mandatory = false,
111+
HelpMessage = "Enable or disable dedicated connection per backend server. Default is set to false.")]
112+
public bool? DedicatedBackendConnection { get; set; }
113+
114+
[Parameter(
115+
Mandatory = false,
116+
HelpMessage = "Verify or skip both chain and expiry validations of the certificate on the backend server. Default is set to true.")]
117+
public bool? ValidateCertChainAndExpiry { get; set; }
118+
119+
[Parameter(
120+
Mandatory = false,
121+
HelpMessage = "When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.")]
122+
public bool? ValidateSNI { get; set; }
123+
124+
[Parameter(
125+
Mandatory = false,
126+
HelpMessage = "Specify an SNI value to match the common name of the certificate on the backend. By default, the application gateway uses the incoming request's host header as the SNI. Default value is null.")]
127+
[ValidateNotNullOrEmpty]
128+
public string SniName { get; set; }
129+
109130
public override void ExecuteCmdlet()
110131
{
111132
base.ExecuteCmdlet();
@@ -189,6 +210,40 @@ public PSApplicationGatewayBackendHttpSettings NewObject()
189210
backendHttpSettings.Path = this.Path;
190211
}
191212

213+
if (this.DedicatedBackendConnection.HasValue)
214+
{
215+
backendHttpSettings.DedicatedBackendConnection = this.DedicatedBackendConnection.Value;
216+
}
217+
else
218+
{
219+
// Default value is false according to the API specification
220+
backendHttpSettings.DedicatedBackendConnection = false;
221+
}
222+
if (this.ValidateCertChainAndExpiry.HasValue)
223+
{
224+
backendHttpSettings.ValidateCertChainAndExpiry = this.ValidateCertChainAndExpiry.Value;
225+
}
226+
else
227+
{
228+
// Default value is true according to the API specification
229+
backendHttpSettings.ValidateCertChainAndExpiry = true;
230+
}
231+
232+
if (this.ValidateSNI.HasValue)
233+
{
234+
backendHttpSettings.ValidateSNI = this.ValidateSNI.Value;
235+
}
236+
else
237+
{
238+
// Default value is true according to the API specification
239+
backendHttpSettings.ValidateSNI = true;
240+
}
241+
242+
if (this.SniName != null)
243+
{
244+
backendHttpSettings.SniName = this.SniName;
245+
}
246+
192247
backendHttpSettings.Id = ApplicationGatewayChildResourceHelper.GetResourceNotSetId(
193248
this.NetworkClient.NetworkManagementClient.SubscriptionId,
194249
Microsoft.Azure.Commands.Network.Properties.Resources.ApplicationGatewaybackendHttpSettingsName,

src/Network/Network/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
## Upcoming Release
2222
* Onboarded Application Gateway WAF Exceptions cmdlet.
2323
- `New-AzApplicationGatewayFirewallPolicyException`
24+
* Added properties 'DedicatedBackendConnection', 'ValidateCertChainAndExpiry', 'ValidateSNI', and 'SniName' to Application Gateway Backend HTTP Settings, as well as support for them in the following cmdlets:
25+
- `New-AzApplicationGatewayBackendHttpSetting`
26+
- `Add-AzApplicationGatewayBackendHttpSetting`
27+
- `Set-AzApplicationGatewayBackendHttpSetting`
2428

2529
## Version 7.17.0
2630
* Added properties 'PublicIpAddressesV6', 'PublicIpPrefixesV6', and 'SourceVirtualNetwork' to NatGateway, as well as support for it for the following cmdlets:

src/Network/Network/Models/PSApplicationGatewayBackendHttpSettings.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ public class PSApplicationGatewayBackendHttpSettings : PSChildResource
4545
[Ps1Xml(Target = ViewControl.Table)]
4646
public string ProvisioningState { get; set; }
4747
public string Type { get; set; }
48+
[Ps1Xml(Target = ViewControl.Table)]
49+
public bool? DedicatedBackendConnection { get; set; }
50+
[Ps1Xml(Target = ViewControl.Table)]
51+
public bool? ValidateCertChainAndExpiry { get; set; }
52+
[Ps1Xml(Target = ViewControl.Table)]
53+
public bool? ValidateSNI { get; set; }
54+
[Ps1Xml(Target = ViewControl.Table)]
55+
public string SniName { get; set; }
4856

4957
[JsonIgnore]
5058
public string ConnectionDrainingText

src/Network/Network/help/Add-AzApplicationGatewayBackendHttpSetting.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Add-AzApplicationGatewayBackendHttpSetting -ApplicationGateway <PSApplicationGat
2020
[-AuthenticationCertificates <PSApplicationGatewayAuthenticationCertificate[]>]
2121
[-TrustedRootCertificate <PSApplicationGatewayTrustedRootCertificate[]>] [-PickHostNameFromBackendAddress]
2222
[-HostName <String>] [-AffinityCookieName <String>] [-Path <String>]
23+
[-DedicatedBackendConnection <Boolean>] [-ValidateCertChainAndExpiry <Boolean>] [-ValidateSNI <Boolean>]
24+
[-SniName <String>]
2325
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2426
```
2527

@@ -295,6 +297,66 @@ Accept pipeline input: False
295297
Accept wildcard characters: False
296298
```
297299
300+
### -DedicatedBackendConnection
301+
Enable or disable dedicated connection per backend server. Default is set to false.
302+
303+
```yaml
304+
Type: System.Boolean
305+
Parameter Sets: (All)
306+
Aliases:
307+
308+
Required: False
309+
Position: Named
310+
Default value: False
311+
Accept pipeline input: False
312+
Accept wildcard characters: False
313+
```
314+
315+
### -ValidateCertChainAndExpiry
316+
Verify or skip both chain and expiry validations of the certificate on the backend server. Default is set to true.
317+
318+
```yaml
319+
Type: System.Boolean
320+
Parameter Sets: (All)
321+
Aliases:
322+
323+
Required: False
324+
Position: Named
325+
Default value: True
326+
Accept pipeline input: False
327+
Accept wildcard characters: False
328+
```
329+
330+
### -ValidateSNI
331+
When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.
332+
333+
```yaml
334+
Type: System.Boolean
335+
Parameter Sets: (All)
336+
Aliases:
337+
338+
Required: False
339+
Position: Named
340+
Default value: True
341+
Accept pipeline input: False
342+
Accept wildcard characters: False
343+
```
344+
345+
### -SniName
346+
Specify an SNI value to match the common name of the certificate on the backend. By default, the application gateway uses the incoming request's host header as the SNI. Default value is null.
347+
348+
```yaml
349+
Type: System.String
350+
Parameter Sets: (All)
351+
Aliases:
352+
353+
Required: False
354+
Position: Named
355+
Default value: None
356+
Accept pipeline input: False
357+
Accept wildcard characters: False
358+
```
359+
298360
### CommonParameters
299361
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
300362

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ New-AzApplicationGatewayBackendHttpSetting -Name <String> -Port <Int32> -Protoco
2020
[-AuthenticationCertificates <PSApplicationGatewayAuthenticationCertificate[]>]
2121
[-TrustedRootCertificate <PSApplicationGatewayTrustedRootCertificate[]>] [-PickHostNameFromBackendAddress]
2222
[-HostName <String>] [-AffinityCookieName <String>] [-Path <String>]
23+
[-DedicatedBackendConnection <Boolean>] [-ValidateCertChainAndExpiry <Boolean>]
24+
[-ValidateSNI <Boolean>]
25+
[-SniName <String>]
2326
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2427
```
2528

@@ -279,6 +282,66 @@ Accept pipeline input: False
279282
Accept wildcard characters: False
280283
```
281284
285+
### -DedicatedBackendConnection
286+
Enable or disable dedicated connection per backend server. Default is set to false.
287+
288+
```yaml
289+
Type: System.Boolean
290+
Parameter Sets: (All)
291+
Aliases:
292+
293+
Required: False
294+
Position: Named
295+
Default value: False
296+
Accept pipeline input: False
297+
Accept wildcard characters: False
298+
```
299+
300+
### -ValidateCertChainAndExpiry
301+
Verify or skip both chain and expiry validations of the certificate on the backend server. Default is set to true.
302+
303+
```yaml
304+
Type: System.Boolean
305+
Parameter Sets: (All)
306+
Aliases:
307+
308+
Required: False
309+
Position: Named
310+
Default value: True
311+
Accept pipeline input: False
312+
Accept wildcard characters: False
313+
```
314+
315+
### -ValidateSNI
316+
When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.
317+
318+
```yaml
319+
Type: System.Boolean
320+
Parameter Sets: (All)
321+
Aliases:
322+
323+
Required: False
324+
Position: Named
325+
Default value: True
326+
Accept pipeline input: False
327+
Accept wildcard characters: False
328+
```
329+
330+
### -SniName
331+
Specify an SNI value to match the common name of the certificate on the backend. By default, the application gateway uses the incoming request's host header as the SNI. Default value is null.
332+
333+
```yaml
334+
Type: System.String
335+
Parameter Sets: (All)
336+
Aliases:
337+
338+
Required: False
339+
Position: Named
340+
Default value: None
341+
Accept pipeline input: False
342+
Accept wildcard characters: False
343+
```
344+
282345
### CommonParameters
283346
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
284347

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Set-AzApplicationGatewayBackendHttpSetting -ApplicationGateway <PSApplicationGat
2020
[-AuthenticationCertificates <PSApplicationGatewayAuthenticationCertificate[]>]
2121
[-TrustedRootCertificate <PSApplicationGatewayTrustedRootCertificate[]>] [-PickHostNameFromBackendAddress]
2222
[-HostName <String>] [-AffinityCookieName <String>] [-Path <String>]
23+
[-DedicatedBackendConnection <Boolean>] [-ValidateCertChainAndExpiry <Boolean>]
24+
[-ValidateSNI <Boolean>]
25+
[-SniName <String>]
2326
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2427
```
2528

@@ -297,6 +300,66 @@ Accept pipeline input: False
297300
Accept wildcard characters: False
298301
```
299302
303+
### -DedicatedBackendConnection
304+
Enable or disable dedicated connection per backend server. Default is set to false.
305+
306+
```yaml
307+
Type: System.Boolean
308+
Parameter Sets: (All)
309+
Aliases:
310+
311+
Required: False
312+
Position: Named
313+
Default value: False
314+
Accept pipeline input: False
315+
Accept wildcard characters: False
316+
```
317+
318+
### -ValidateCertChainAndExpiry
319+
Verify or skip both chain and expiry validations of the certificate on the backend server. Default is set to true.
320+
321+
```yaml
322+
Type: System.Boolean
323+
Parameter Sets: (All)
324+
Aliases:
325+
326+
Required: False
327+
Position: Named
328+
Default value: True
329+
Accept pipeline input: False
330+
Accept wildcard characters: False
331+
```
332+
333+
### -ValidateSNI
334+
When enabled, verifies if the Common Name of the certificate provided by the backend server matches the Server Name Indication (SNI) value. Default value is true.
335+
336+
```yaml
337+
Type: System.Boolean
338+
Parameter Sets: (All)
339+
Aliases:
340+
341+
Required: False
342+
Position: Named
343+
Default value: True
344+
Accept pipeline input: False
345+
Accept wildcard characters: False
346+
```
347+
348+
### -SniName
349+
Specify an SNI value to match the common name of the certificate on the backend. By default, the application gateway uses the incoming request's host header as the SNI. Default value is null.
350+
351+
```yaml
352+
Type: System.String
353+
Parameter Sets: (All)
354+
Aliases:
355+
356+
Required: False
357+
Position: Named
358+
Default value: None
359+
Accept pipeline input: False
360+
Accept wildcard characters: False
361+
```
362+
300363
### CommonParameters
301364
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
302365

0 commit comments

Comments
 (0)