Skip to content

Commit 0bb724b

Browse files
jessicl-msisra-fel
authored andcommitted
Add support for setting CustomHttpsConfiguration::MinimumTlsVersion, BackendPoolsSettings::SendRecvTimeoutSeconds, HealthProbeSettings::HealthProbeMethod, and HealthProbeSettings::EnabledState to Az.FrontDoor module (Azure#10342)
* Update nuget package to contain Front Door Swagger updates * Implement HealthProbeSettings:EnabledState and HealthProbeSettings:HealthProbeMethod * Use PSEnabledState instead of bool for HealthProbeSettings:EnabledState * Update to nullable types. Default values will be set in backend * Add NewAzureRmBackendPoolsSettingsObject * ProtocolType is static type with just one possible value, so commented out. Will remove if verification successful * Update models to include BackendPoolsSettings and replace PSEnforceCertificateNameChecks * Update NewAzureRmFrontDoor cmdlet * Update models and helpers * Update parameter set names * Update Set-AzureRmFrontDoor cmdlet implementation * Fix compilation errors * Update BackendPoolSettings parameters to be not mandatory * Update module manifest to add cmdlet New-AzureRmBackendPoolsSettingsObject * Generate markdown help for modified cmdlets: New-AzFrontDoor, New-AzFronDoorBackendPoolsSettingsObject, Set-AzFrontDoor * Update Scenario Tests * Fix EnabledState parsing in BackendPoolsSettings conversion * In progress. Update CustomHttpsConfiguration settings to be compatible with SDK * Fix build errors * Implement NewAzureRmFrontDoorCustomHttpsConfigurationObject.cs * Add CustomHttpsConfiguration to ModelExtensions * Remove CustomHttpsConfigurationObject * Clean up cmdlet code * Add back certificate source parameter to PSFrontDoor * Small updates to .md help * Fix scenario test frontdoor CRUD * Fix scenario test for frontdoor CRUD redirect and CRUD with piping * Add MinimumTlsVersion to Enable-AzFrontDoorCustomDomainHttps and update scenario test * Remove BackendPoolsSettings::Name because is not defined in Swagger * Fix SdkValut to SdkVault and correct help comments in NewAzureRmFrontDoorFrontendEndpointObject * Unswap settig descriptions in Set-AzRMFrontDoor * Fix cmdlets and update documentation. * Update Enable-AzFrontDoorCustomDomainHttps documentation * Add test to verify default values for HealthProbeSettings and BackendPoolsSettings * Fix broken scenario test TestFrontDoorCRUDRedirect * Update Test-FrontDoorCrudWithPiping * Add argument completer to New-AzFrontDoorHealthProbeSettingsObject and add argument completer to New-AzFrontDoor, New-AzFrontDoorBackendObject, New-AzFrontDoorBackendPoolsSettingsObject, Set-AzFrontDoor, Enable-AzFrontDoorCustomDomainHttps * Change SendRecvTimeoutSeconds -> SendRecvTimeoutInSeconds, BackendPoolsSettings -> BackendPoolsSettings Updated implementation, tests, and documentation. * Change New-AzFrontDoorBackendPoolsSettingsObject -> New-AzFrontDoorBackendPoolsSettingObject. Updated implementation, documentation, and tests * Update SessionRecords * Add online version link to new cmdlet New-AzFrontDoorBackendPoolsSettingObject * Fix static analysis issue with ProtocolType * Add exception for static anaysis signature issue * Revert "Add exception for static anaysis signature issue" This reverts commit 1234264. * Readd New-AzFrontDoorBackendPoolsSettingsObject to signature issues exception * Simply parameter sets to try to resolve static analysis error * Update documentation for Set-AzFrontDoor * Update parameter sets and documentation for Set-AzFrontDoor * Add _AllParameters to BreakingChangeIssues exception * Change default parameter set to FieldsParameterSet * Use 9 originally proposed parameter sets * Update Set-AzFrontDoor to take 9 parameter sets * Remove PSArgumentCompleter for enums and add for strings * Populate PSFrontDoor.EnforceCertificateNameCheck with PSFrontDoor.PSBackendPoolsSetting.EnforceCertificateNameCheck, event though PSFrontDoor.EnforceCertificateNameCheck is not beig actively used, so that they have consistent values * Update examples in New-AzFrontDoor and Set-AzFrontDoor to use -BackendPoolsSetting and show it in returned object * Removed 'Shared' from CertificateType b/c no longer supported * Update ChangeLog.md
1 parent edbef15 commit 0bb724b

33 files changed

+4199
-1343
lines changed

src/FrontDoor/FrontDoor.Test/FrontDoor.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.FrontDoor" Version="0.13.0-preview" />
14+
<PackageReference Include="Microsoft.Azure.Management.FrontDoor" Version="1.0.0" />
1515
</ItemGroup>
1616

1717
</Project>

src/FrontDoor/FrontDoor.Test/ScenarioTests/FrontDoorTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Microsoft.Azure.Commands.FrontDoor.Test.ScenarioTests.ScenarioTest
2020
{
2121
public class FrontDoorTests
2222
{
23-
private ServiceManagement.Common.Models.XunitTracingInterceptor _logger;
23+
private readonly ServiceManagement.Common.Models.XunitTracingInterceptor _logger;
2424

2525
public FrontDoorTests(Xunit.Abstractions.ITestOutputHelper output)
2626
{
@@ -35,6 +35,13 @@ public void TestFrontDoorCrud()
3535
TestController.NewInstance.RunPowerShellTest(_logger, "Test-FrontDoorCrud");
3636
}
3737

38+
[Fact]
39+
[Trait(Category.AcceptanceType, Category.CheckIn)]
40+
public void TestFrontDoorCrudDefaults()
41+
{
42+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-FrontDoorCrudDefaults");
43+
}
44+
3845
[Fact]
3946
[Trait(Category.AcceptanceType, Category.CheckIn)]
4047
public void TestFrontDoorCrudWithPiping()

src/FrontDoor/FrontDoor.Test/ScenarioTests/FrontDoorTests.ps1

Lines changed: 112 additions & 16 deletions
Large diffs are not rendered by default.

src/FrontDoor/FrontDoor.Test/SessionRecords/Microsoft.Azure.Commands.FrontDoor.Test.ScenarioTests.ScenarioTest.FrontDoorTests/TestFrontDoorCrud.json

Lines changed: 485 additions & 278 deletions
Large diffs are not rendered by default.

src/FrontDoor/FrontDoor.Test/SessionRecords/Microsoft.Azure.Commands.FrontDoor.Test.ScenarioTests.ScenarioTest.FrontDoorTests/TestFrontDoorCrudDefaults.json

Lines changed: 1330 additions & 0 deletions
Large diffs are not rendered by default.

src/FrontDoor/FrontDoor.Test/SessionRecords/Microsoft.Azure.Commands.FrontDoor.Test.ScenarioTests.ScenarioTest.FrontDoorTests/TestFrontDoorCrudRedirect.json

Lines changed: 334 additions & 457 deletions
Large diffs are not rendered by default.

src/FrontDoor/FrontDoor.Test/SessionRecords/Microsoft.Azure.Commands.FrontDoor.Test.ScenarioTests.ScenarioTest.FrontDoorTests/TestFrontDoorCrudWithPiping.json

Lines changed: 227 additions & 227 deletions
Large diffs are not rendered by default.

src/FrontDoor/FrontDoor.Test/SessionRecords/Microsoft.Azure.Commands.FrontDoor.Test.ScenarioTests.ScenarioTest.FrontDoorTests/TestFrontDoorEndpointCustomDomainHTTPSFrontDoor.json

Lines changed: 1032 additions & 207 deletions
Large diffs are not rendered by default.

src/FrontDoor/FrontDoor/Az.FrontDoor.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ FunctionsToExport = @()
7777
CmdletsToExport = 'New-AzFrontDoor', 'Get-AzFrontDoor', 'Set-AzFrontDoor',
7878
'Remove-AzFrontDoor', 'New-AzFrontDoorRoutingRuleObject',
7979
'New-AzFrontDoorBackendObject', 'New-AzFrontDoorBackendPoolObject',
80+
'New-AzFrontDoorBackendPoolsSettingObject',
8081
'New-AzFrontDoorFrontendEndpointObject',
8182
'New-AzFrontDoorHealthProbeSettingObject',
8283
'New-AzFrontDoorLoadBalancingSettingObject',

src/FrontDoor/FrontDoor/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Add MinimumTlsVersion parameter to Enable-AzFrontDoorCustomDomainHttps and New-AzFrontDoorFrontendEndpointObject
22+
* Add HealthProbeMethod and EnabledState parameters to New-AzFrontDoorHealthProbeSettingObject
23+
* Add new cmdlet to create BackendPoolsSettings objec to pass into creation/update of Front Door
24+
- New-AzFrontDoorBackendPoolsSettingObject
2125

2226
## Version 1.1.2
2327
* Fixed miscellaneous typos across module

src/FrontDoor/FrontDoor/Cmdlets/EnableAzureRmFrontDoorCustomDomainHttps.cs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,22 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System;
16-
using System.Collections;
17-
using System.Management.Automation;
18-
using System.Net;
1915
using Microsoft.Azure.Commands.FrontDoor.Common;
2016
using Microsoft.Azure.Commands.FrontDoor.Helpers;
2117
using Microsoft.Azure.Commands.FrontDoor.Models;
2218
using Microsoft.Azure.Commands.FrontDoor.Properties;
23-
using Microsoft.Azure.Management.FrontDoor;
24-
using System.Linq;
2519
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
20+
using Microsoft.Azure.Management.FrontDoor;
2621
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
22+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
23+
using System.Management.Automation;
2724

2825
namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
2926
{
3027
/// <summary>
3128
/// Defines the Enable-AzCustomDomainHttps cmdlet.
3229
/// </summary>
33-
[Cmdlet("Enable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorCustomDomainHttps", SupportsShouldProcess = true, DefaultParameterSetName = FieldsParameterSet), OutputType(typeof(PSFrontendEndpoint))]
30+
[Cmdlet("Enable", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorCustomDomainHttps", SupportsShouldProcess = true, DefaultParameterSetName = FieldsParameterSet), OutputType(typeof(PSFrontendEndpoint))]
3431
public class EnableAzureRmFrontDoorCustomDomainHttps : AzureFrontDoorCmdletBase
3532
{
3633
/// <summary>
@@ -99,6 +96,13 @@ public class EnableAzureRmFrontDoorCustomDomainHttps : AzureFrontDoorCmdletBase
9996
[Parameter(Mandatory = true, ParameterSetName = ObjectWithVaultParameterSet, HelpMessage = "The version of the Key Vault secret representing the full certificate PFX")]
10097
public string SecretVersion { get; set; }
10198

99+
/// <summary>
100+
/// The minimum TLS version required from the clients to establish an SSL handshake with Front Door.
101+
/// </summary>
102+
[Parameter(Mandatory = false, HelpMessage = "The minimum TLS version required from the clients to establish an SSL handshake with Front Door.")]
103+
[PSArgumentCompleter("1.0", "1.2")]
104+
public string MinimumTlsVersion { get; set; }
105+
102106
public override void ExecuteCmdlet()
103107
{
104108
try
@@ -137,14 +141,21 @@ public override void ExecuteCmdlet()
137141
customHttpsConfiguration.SecretVersion = SecretVersion;
138142
}
139143

140-
customHttpsConfiguration.ProtocolType = PSProtocolType.ServerNameIndication.ToString();
141-
144+
if (this.IsParameterBound(c => c.MinimumTlsVersion))
145+
{
146+
customHttpsConfiguration.MinimumTlsVersion = MinimumTlsVersion;
147+
}
148+
else
149+
{
150+
customHttpsConfiguration.MinimumTlsVersion = "1.2";
151+
}
152+
142153
if (ShouldProcess(Resources.FrontDoorTarget, string.Format(Resources.EnableCustomDomainHttpsWarning, FrontendEndpointName)))
143154
{
144155
FrontDoorManagementClient.FrontendEndpoints.BeginEnableHttps(ResourceGroupName, FrontDoorName, FrontendEndpointName, customHttpsConfiguration);
145156

146157
var frontDoorEndPoint = FrontDoorManagementClient.FrontendEndpoints.Get(ResourceGroupName, FrontDoorName, FrontendEndpointName);
147-
WriteObject(frontDoorEndPoint.ToPSFrontendEndpoints());
158+
WriteObject(frontDoorEndPoint.ToPSFrontendEndpoints());
148159
}
149160
}
150161
catch (Microsoft.Azure.Management.FrontDoor.Models.ErrorResponseException e)

src/FrontDoor/FrontDoor/Cmdlets/NewAzureRmFrontDoor.cs

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
3030
/// <summary>
3131
/// Defines the New-AzFrontDoor cmdlet.
3232
/// </summary>
33-
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoor", SupportsShouldProcess = true), OutputType(typeof(PSFrontDoor))]
33+
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoor", DefaultParameterSetName = FieldsWithBackendPoolsSettingParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSFrontDoor))]
3434
public class NewAzureRmFrontDoor : AzureFrontDoorCmdletBase
3535
{
3636
/// <summary>
@@ -92,9 +92,17 @@ public class NewAzureRmFrontDoor : AzureFrontDoorCmdletBase
9292
/// <summary>
9393
/// Whether to enforce certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests.
9494
/// </summary>
95-
[Parameter(Mandatory = false, HelpMessage = "Whether to disable certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests.")]
95+
[Parameter(ParameterSetName = FieldsWithCertificateNameCheckParameterSet,
96+
Mandatory = false, HelpMessage = "Whether to disable certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests.")]
9697
public SwitchParameter DisableCertificateNameCheck { get; set; }
9798

99+
/// <summary>
100+
/// Settings for all backendPools
101+
/// </summary>
102+
[Parameter(ParameterSetName = FieldsWithBackendPoolsSettingParameterSet,
103+
Mandatory = false, HelpMessage = "Settings for all backendPools")]
104+
public PSBackendPoolsSetting BackendPoolsSetting { get; set; }
105+
98106
public override void ExecuteCmdlet()
99107
{
100108
var existingProfile = FrontDoorManagementClient.FrontDoors.ListByResourceGroup(ResourceGroupName)
@@ -106,6 +114,23 @@ public override void ExecuteCmdlet()
106114
Name,
107115
ResourceGroupName));
108116
}
117+
118+
Management.FrontDoor.Models.BackendPoolsSettings backendPoolsSettings;
119+
switch (ParameterSetName)
120+
{
121+
case FieldsWithCertificateNameCheckParameterSet:
122+
{
123+
backendPoolsSettings = new Management.FrontDoor.Models.BackendPoolsSettings(
124+
DisableCertificateNameCheck ? PSEnforceCertificateNameCheck.Disabled.ToString() : PSEnforceCertificateNameCheck.Enabled.ToString());
125+
break;
126+
}
127+
default:
128+
{
129+
backendPoolsSettings = BackendPoolsSetting?.ToSdkBackendPoolsSettings();
130+
break;
131+
}
132+
}
133+
109134
var updateParameters = new Management.FrontDoor.Models.FrontDoorModel(
110135
id: null,
111136
name: Name,
@@ -118,11 +143,12 @@ public override void ExecuteCmdlet()
118143
healthProbeSettings: HealthProbeSetting?.Select(x => x.ToSdkHealthProbeSetting()).ToList(),
119144
backendPools: BackendPool?.Select(x => x.ToSdkBackendPool()).ToList(),
120145
frontendEndpoints: FrontendEndpoint?.Select(x => x.ToSdkFrontendEndpoints()).ToList(),
121-
enabledState: !this.IsParameterBound(c => c.EnabledState)? "Enabled" : EnabledState.ToString(),
122-
backendPoolsSettings : new Management.FrontDoor.Models.BackendPoolsSettings(
123-
DisableCertificateNameCheck ? PSEnforceCertificateNameCheck.Disabled.ToString() : PSEnforceCertificateNameCheck.Enabled.ToString())
146+
enabledState: !this.IsParameterBound(c => c.EnabledState) ? "Enabled" : EnabledState.ToString(),
147+
backendPoolsSettings: backendPoolsSettings
124148
);
149+
125150
updateParameters.ToPSFrontDoor().ValidateFrontDoor(ResourceGroupName, this.DefaultContext.Subscription.Id);
151+
126152
if (ShouldProcess(Resources.FrontDoorTarget, string.Format(Resources.CreateFrontDoor, Name)))
127153
{
128154
try
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Collections;
17+
using System.Management.Automation;
18+
using System.Net;
19+
using Microsoft.Azure.Commands.FrontDoor.Common;
20+
using Microsoft.Azure.Commands.FrontDoor.Models;
21+
using Microsoft.Azure.Management.FrontDoor;
22+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
23+
using System.Linq;
24+
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
25+
26+
namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
27+
{
28+
/// <summary>
29+
/// Defines the New-AzFrontDoorBackendPoolsSettingsObject cmdlet.
30+
/// </summary>
31+
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FrontDoorBackendPoolsSettingObject"), OutputType(typeof(PSBackendPoolsSetting))]
32+
public class NewAzureRmBackendPoolsSettingObject : AzureFrontDoorCmdletBase
33+
{
34+
/// <summary>
35+
/// Whether to enforce certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests.
36+
/// </summary>
37+
[Parameter(Mandatory = false, HelpMessage = "Whether to enforce certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests.")]
38+
public PSEnabledState EnforceCertificateNameCheck { get; set; }
39+
40+
/// <summary>
41+
/// Send and receive timeout on forwarding request to the backend. When timeout is reached, the request fails and returns.
42+
/// </summary>
43+
[Parameter(Mandatory = false, HelpMessage = "Send and receive timeout on forwarding request to the backend. When timeout is reached, the request fails and returns.")]
44+
public int SendRecvTimeoutInSeconds { get; set; }
45+
46+
public override void ExecuteCmdlet()
47+
{
48+
var backendPoolsSetting = new PSBackendPoolsSetting
49+
{
50+
EnforceCertificateNameCheck = !this.IsParameterBound(c => c.EnforceCertificateNameCheck) ? PSEnabledState.Enabled : EnforceCertificateNameCheck,
51+
SendRecvTimeoutInSeconds = !this.IsParameterBound(c => c.SendRecvTimeoutInSeconds) ? 30 : SendRecvTimeoutInSeconds
52+
};
53+
WriteObject(backendPoolsSetting);
54+
}
55+
}
56+
}

src/FrontDoor/FrontDoor/Cmdlets/NewAzureRmFrontDoorFrontendEndpointObject.cs

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,11 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System;
16-
using System.Collections;
17-
using System.Management.Automation;
18-
using System.Net;
1915
using Microsoft.Azure.Commands.FrontDoor.Common;
2016
using Microsoft.Azure.Commands.FrontDoor.Models;
21-
using Microsoft.Azure.Management.FrontDoor;
22-
using System.Linq;
23-
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2417
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
18+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
19+
using System.Management.Automation;
2520

2621
namespace Microsoft.Azure.Commands.FrontDoor.Cmdlets
2722
{
@@ -41,11 +36,11 @@ public class NewAzureRmFrontDoorFrontendEndpointObject : AzureFrontDoorCmdletBas
4136
/// <summary>
4237
/// The host name of the frontendEndpoint. Must be a domain name.
4338
/// </summary>
44-
[Parameter(Mandatory = true, HelpMessage = "The host name of the frontendEndpoint.")]
39+
[Parameter(Mandatory = true, HelpMessage = "The host name of the frontendEndpoint.")]
4540
public string HostName { get; set; }
4641

4742
/// <summary>
48-
/// Whether to allow session affinity on this host. Valid options are ‘Enabled’ or ‘Disabled’
43+
/// Whether to allow session affinity on this host. Valid options are ‘Enabled’ or ‘Disabled’.
4944
/// </summary>
5045
[Parameter(Mandatory = false, HelpMessage = "Whether to allow session affinity on this host. Default value is Disabled")]
5146
public PSEnabledState SessionAffinityEnabledState { get; set; }
@@ -57,48 +52,55 @@ public class NewAzureRmFrontDoorFrontendEndpointObject : AzureFrontDoorCmdletBas
5752
public int SessionAffinityTtlInSeconds { get; set; }
5853

5954
/// <summary>
60-
/// The resource id of Web Application Firewall policy for each host (if applicable)
55+
/// The resource id of Web Application Firewall policy for each host (if applicable).
6156
/// </summary>
6257
[Parameter(Mandatory = false, HelpMessage = "The resource id of Web Application Firewall policy for each host (if applicable)")]
6358
public string WebApplicationFirewallPolicyLink { get; set; }
6459

6560
/// <summary>
66-
/// The source of the SSL certificate
61+
/// The source of the SSL certificate.
6762
/// </summary>
6863
[Parameter(Mandatory = false, HelpMessage = "The source of the SSL certificate")]
6964
[PSArgumentCompleter("AzureKeyVault", "FrontDoor")]
7065
public string CertificateSource { get; set; }
7166

7267
/// <summary>
73-
/// Defines the TLS extension protocol that is used for secure delivery
68+
/// The minimum TLS version required from the clients to establish an SSL handshake with Front Door.
69+
/// </summary>
70+
[Parameter(Mandatory = false, HelpMessage = "The minimum TLS version required from the clients to establish an SSL handshake with Front Door.")]
71+
[PSArgumentCompleter("1.0", "1.2")]
72+
public string MinimumTlsVersion { get; set; }
73+
74+
/// <summary>
75+
/// Defines the TLS extension protocol that is used for secure delivery.
7476
/// </summary>
7577
[Parameter(Mandatory = false, HelpMessage = "The TLS extension protocol that is used for secure delivery")]
76-
[PSArgumentCompleter("ServerNameIndication", "IPBased")]
78+
[PSArgumentCompleter("ServerNameIndication")]
7779
public string ProtocolType { get; set; }
7880

7981
/// <summary>
80-
/// Defines the TLS extension protocol that is used for secure delivery
82+
/// Defines the TLS extension protocol that is used for secure delivery.
8183
/// </summary>
8284
[Parameter(Mandatory = false, HelpMessage = "The Key Vault containing the SSL certificate")]
8385
public string Vault { get; set; }
8486

8587
/// <summary>
86-
/// The name of the Key Vault secret representing the full certificate PFX
88+
/// The name of the Key Vault secret representing the full certificate PFX.
8789
/// </summary>
8890
[Parameter(Mandatory = false, HelpMessage = "The name of the Key Vault secret representing the full certificate PFX")]
8991
public string SecretName { get; set; }
9092

9193
/// <summary>
92-
/// The version of the Key Vault secret representing the full certificate PFX
94+
/// The version of the Key Vault secret representing the full certificate PFX.
9395
/// </summary>
9496
[Parameter(Mandatory = false, HelpMessage = "The version of the Key Vault secret representing the full certificate PFX")]
9597
public string SecretVersion { get; set; }
9698

9799
/// <summary>
98-
/// the type of the certificate used for secure connections to a frontendEndpoint
100+
/// The type of the certificate used for secure connections to a frontendEndpoint.
99101
/// </summary>
100-
[Parameter(Mandatory = false, HelpMessage = "the type of the certificate used for secure connections to a frontendEndpoint")]
101-
[PSArgumentCompleter("Shared", "Dedicated")]
102+
[Parameter(Mandatory = false, HelpMessage = "The type of the certificate used for secure connections to a frontendEndpoint")]
103+
[PSArgumentCompleter("Dedicated")]
102104
public string CertificateType { get; set; }
103105

104106
public override void ExecuteCmdlet()
@@ -107,15 +109,16 @@ public override void ExecuteCmdlet()
107109
{
108110
Name = Name,
109111
HostName = HostName,
110-
SessionAffinityEnabledState = !this.IsParameterBound(c => c.SessionAffinityEnabledState)? PSEnabledState.Disabled : SessionAffinityEnabledState,
112+
SessionAffinityEnabledState = !this.IsParameterBound(c => c.SessionAffinityEnabledState) ? PSEnabledState.Disabled : SessionAffinityEnabledState,
111113
SessionAffinityTtlSeconds = !this.IsParameterBound(c => c.SessionAffinityTtlInSeconds) ? 0 : SessionAffinityTtlInSeconds,
112114
WebApplicationFirewallPolicyLink = WebApplicationFirewallPolicyLink,
113115
CertificateSource = CertificateSource,
114116
CertificateType = CertificateType,
115117
Vault = Vault,
116118
SecretName = SecretName,
117119
SecretVersion = SecretVersion,
118-
ProtocolType = ProtocolType
120+
ProtocolType = this.IsParameterBound(c => c.ProtocolType) ? ProtocolType : "ServerNameIndication",
121+
MinimumTlsVersion = MinimumTlsVersion
119122
};
120123
WriteObject(FrontendEndpoint);
121124
}

0 commit comments

Comments
 (0)