Skip to content

Commit 81dd4dc

Browse files
authored
[Az.ServiceFabric] Added parameter AutoGeneratedDomainNameLabelScope to allow customers to initiate migration to public CA cluster certificates in cmdlet New-AzServiceFabricManagedCluster and Set-AzServiceFabricManagedCluster (#28349)
1 parent 5df78f7 commit 81dd4dc

File tree

8 files changed

+1462
-61
lines changed

8 files changed

+1462
-61
lines changed

src/ServiceFabric/ServiceFabric.Test/SessionRecords/Microsoft.Azure.Commands.ServiceFabric.Test.ScenarioTests.ServiceFabricManagedClustersTests/TestCreateCaTlsCertCluster.json

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

src/ServiceFabric/ServiceFabric/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
## Upcoming Release
2121
* Updated SF to latest api preview version `2023-11-01-preview`
2222
* Fixed `Set-AzServiceFabricManagedClusterApplication` to correctly overwrite existing application upgrade policy when `-RecreateApplication` parameter is specified and no other upgrade policy parameters are bound.
23+
* Added parameter `AutoGeneratedDomainNameLabelScope` to allow customers to initiate migration to public CA cluster certificates in cmdlet `New-AzServiceFabricManagedCluster` and `Set-AzServiceFabricManagedCluster`.
2324

2425
## Version 3.6.0
2526
* Added parameter `Location` to allow users to specify a different node type location than the resource group location in cmdlet `Add-AzServiceFabricNodeType`.

src/ServiceFabric/ServiceFabric/Commands/ManagedClusters/ManagedClusters/NewAzServiceFabricManagedCluster.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ public class NewAzServiceFabricManagedCluster : ServiceFabricManagedCmdletBase
140140
[Parameter(Mandatory = false, ParameterSetName = ClientCertByCn, HelpMessage = "Indicates if the cluster has zone resiliency.")]
141141
public SwitchParameter ZonalResiliency { get; set; }
142142

143+
[Parameter(Mandatory = false, ParameterSetName = ClientCertByTp, HelpMessage = "This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert.")]
144+
[Parameter(Mandatory = false, ParameterSetName = ClientCertByCn, HelpMessage = "This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert.")]
145+
public string AutoGeneratedDomainNameLabelScope { get; set; }
146+
143147
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background and return a Job to track progress.")]
144148
public SwitchParameter AsJob { get; set; }
145149

@@ -236,6 +240,7 @@ private ManagedCluster GetNewManagedClusterParameters()
236240
clusterUpgradeMode: this.UpgradeMode.ToString(),
237241
clusterUpgradeCadence: this.UpgradeCadence.ToString(),
238242
zonalResiliency: this.ZonalResiliency.IsPresent,
243+
autoGeneratedDomainNameLabelScope: this.AutoGeneratedDomainNameLabelScope,
239244
tags: this.Tag?.Cast<DictionaryEntry>().ToDictionary(d => d.Key as string, d => d.Value as string)
240245
);
241246

src/ServiceFabric/ServiceFabric/Commands/ManagedClusters/ManagedClusters/SetAzServiceFabricManagedCluster.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ public class SetAzServiceFabricManagedCluster : ServiceFabricManagedCmdletBase
8282
[Parameter(Mandatory = false, ParameterSetName = WithParamsById, HelpMessage = "Cluster's dns name.")]
8383
public string DnsName { get; set; }
8484

85+
[Parameter(Mandatory = false, ParameterSetName = WithParamsByName, HelpMessage = "This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert.")]
86+
[Parameter(Mandatory = false, ParameterSetName = WithParamsById, HelpMessage = "This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert.")]
87+
public string AutoGeneratedDomainNameLabelScope { get; set; }
88+
8589
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background and return a Job to track progress.")]
8690
public SwitchParameter AsJob { get; set; }
87-
88-
91+
8992
[Parameter(Mandatory = false, ParameterSetName = WithParamsByName, HelpMessage = "Specify the tags as key/value pairs.")]
9093
[Parameter(Mandatory = false, ParameterSetName = WithParamsById, HelpMessage = "Specify the tags as key/value pairs.")]
9194
public Hashtable Tag { get; set; }
@@ -158,6 +161,11 @@ private ManagedCluster GetUpdatedClusterParams()
158161
currentCluster.PublicIPPrefixId = null;
159162
}
160163

164+
if (this.IsParameterBound(c => c.AutoGeneratedDomainNameLabelScope))
165+
{
166+
currentCluster.AutoGeneratedDomainNameLabelScope = this.AutoGeneratedDomainNameLabelScope;
167+
}
168+
161169
return currentCluster;
162170
}
163171

src/ServiceFabric/ServiceFabric/Models/ManagedClusters/PSManagedCluster.cs

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,56 @@ namespace Microsoft.Azure.Commands.ServiceFabric.Models
1919
public class PSManagedCluster : ManagedCluster
2020
{
2121
public PSManagedCluster(ManagedCluster cluster)
22-
: base(location: cluster.Location,
23-
id: cluster.Id,
24-
name: cluster.Name,
25-
type: cluster.Type,
26-
tags: cluster.Tags,
27-
etag: cluster.Etag,
28-
clusterId: cluster.ClusterId,
29-
addonFeatures: cluster.AddonFeatures,
30-
clusterUpgradeCadence: cluster.ClusterUpgradeCadence,
31-
clusterUpgradeMode: cluster.ClusterUpgradeMode,
32-
clusterCodeVersion: cluster.ClusterCodeVersion,
33-
provisioningState: cluster.ProvisioningState,
34-
fabricSettings: cluster.FabricSettings,
35-
azureActiveDirectory: cluster.AzureActiveDirectory,
36-
clients: cluster.Clients,
37-
networkSecurityRules: cluster.NetworkSecurityRules,
38-
loadBalancingRules: cluster.LoadBalancingRules,
39-
adminPassword: cluster.AdminPassword,
40-
adminUserName: cluster.AdminUserName,
41-
httpGatewayConnectionPort: cluster.HttpGatewayConnectionPort,
42-
clientConnectionPort: cluster.ClientConnectionPort,
43-
clusterCertificateThumbprints: cluster.ClusterCertificateThumbprints,
44-
clusterState: cluster.ClusterState,
45-
ipv4Address: cluster.Ipv4Address,
46-
fqdn: cluster.Fqdn,
47-
dnsName: cluster.DnsName,
48-
applicationTypeVersionsCleanupPolicy: cluster.ApplicationTypeVersionsCleanupPolicy,
49-
sku: cluster.Sku,
50-
zonalResiliency: cluster.ZonalResiliency,
51-
allowRdpAccess: cluster.AllowRdpAccess,
52-
enableAutoOSUpgrade: cluster.EnableAutoOSUpgrade,
53-
publicIPPrefixId: cluster.PublicIPPrefixId)
22+
: base(
23+
addonFeatures: cluster.AddonFeatures,
24+
adminPassword: cluster.AdminPassword,
25+
adminUserName: cluster.AdminUserName,
26+
allocatedOutboundPorts: cluster.AllocatedOutboundPorts,
27+
allowRdpAccess: cluster.AllowRdpAccess,
28+
applicationTypeVersionsCleanupPolicy: cluster.ApplicationTypeVersionsCleanupPolicy,
29+
autoGeneratedDomainNameLabelScope: cluster.AutoGeneratedDomainNameLabelScope,
30+
auxiliarySubnets: cluster.AuxiliarySubnets,
31+
azureActiveDirectory: cluster.AzureActiveDirectory,
32+
clientConnectionPort: cluster.ClientConnectionPort,
33+
clients: cluster.Clients,
34+
clusterCertificateThumbprints: cluster.ClusterCertificateThumbprints,
35+
clusterCodeVersion: cluster.ClusterCodeVersion,
36+
clusterId: cluster.ClusterId,
37+
clusterState: cluster.ClusterState,
38+
clusterUpgradeCadence: cluster.ClusterUpgradeCadence,
39+
clusterUpgradeMode: cluster.ClusterUpgradeMode,
40+
ddosProtectionPlanId: cluster.DdosProtectionPlanId,
41+
dnsName: cluster.DnsName,
42+
enableAutoOSUpgrade: cluster.EnableAutoOSUpgrade,
43+
enableHttpGatewayExclusiveAuthMode: cluster.EnableHttpGatewayExclusiveAuthMode,
44+
enableIpv6: cluster.EnableIpv6,
45+
enableServicePublicIP: cluster.EnableServicePublicIP,
46+
etag: cluster.Etag,
47+
fabricSettings: cluster.FabricSettings,
48+
fqdn: cluster.Fqdn,
49+
httpGatewayConnectionPort: cluster.HttpGatewayConnectionPort,
50+
httpGatewayTokenAuthConnectionPort: cluster.HttpGatewayTokenAuthConnectionPort,
51+
id: cluster.Id,
52+
ipTags: cluster.IPTags,
53+
ipv4Address: cluster.Ipv4Address,
54+
ipv6Address: cluster.Ipv6Address,
55+
loadBalancingRules: cluster.LoadBalancingRules,
56+
location: cluster.Location,
57+
name: cluster.Name,
58+
networkSecurityRules: cluster.NetworkSecurityRules,
59+
provisioningState: cluster.ProvisioningState,
60+
publicIPPrefixId: cluster.PublicIPPrefixId,
61+
publicIPv6PrefixId: cluster.PublicIPv6PrefixId,
62+
serviceEndpoints: cluster.ServiceEndpoints,
63+
sku: cluster.Sku,
64+
subnetId: cluster.SubnetId,
65+
tags: cluster.Tags,
66+
type: cluster.Type,
67+
upgradeDescription: cluster.UpgradeDescription,
68+
useCustomVnet: cluster.UseCustomVnet,
69+
vmImage: cluster.VMImage,
70+
zonalResiliency: cluster.ZonalResiliency,
71+
zonalUpdateMode: cluster.ZonalUpdateMode)
5472
{
5573
}
5674
}

src/ServiceFabric/ServiceFabric/Models/ManagedClusters/PSManagedNodeType.cs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,35 @@ public class PSManagedNodeType : NodeType
2020
{
2121
public PSManagedNodeType(NodeType nodeType)
2222
: base(id: nodeType.Id,
23-
name: nodeType.Name,
24-
type: nodeType.Type,
25-
tags: nodeType.Tags,
26-
isPrimary: nodeType.IsPrimary,
27-
vmInstanceCount: nodeType.VMInstanceCount,
23+
applicationPorts: nodeType.ApplicationPorts,
24+
capacities: nodeType.Capacities,
25+
enableNodePublicIP: nodeType.EnableNodePublicIP,
26+
ephemeralPorts: nodeType.EphemeralPorts,
2827
dataDiskSizeGb: nodeType.DataDiskSizeGb,
2928
dataDiskType: nodeType.DataDiskType,
30-
provisioningState: nodeType.ProvisioningState,
29+
dataDiskLetter: nodeType.DataDiskLetter,
30+
isPrimary: nodeType.IsPrimary,
31+
isStateless: nodeType.IsStateless,
32+
multiplePlacementGroups: nodeType.MultiplePlacementGroups,
33+
name: nodeType.Name,
34+
natGatewayId: nodeType.NatGatewayId,
3135
placementProperties: nodeType.PlacementProperties,
32-
capacities: nodeType.Capacities,
33-
applicationPorts: nodeType.ApplicationPorts,
34-
ephemeralPorts: nodeType.EphemeralPorts,
35-
vmSize: nodeType.VMSize,
36-
vmImagePublisher: nodeType.VMImagePublisher,
36+
provisioningState: nodeType.ProvisioningState,
37+
securityType: nodeType.SecurityType,
38+
secureBootEnabled: nodeType.SecureBootEnabled,
39+
tags: nodeType.Tags,
40+
type: nodeType.Type,
41+
vmExtensions: nodeType.VMExtensions,
3742
vmImageOffer: nodeType.VMImageOffer,
43+
vmImagePlan: nodeType.VMImagePlan,
44+
vmImagePublisher: nodeType.VMImagePublisher,
3845
vmImageSku: nodeType.VMImageSku,
3946
vmImageVersion: nodeType.VMImageVersion,
40-
vmSecrets: nodeType.VMSecrets,
41-
vmExtensions: nodeType.VMExtensions,
47+
vmInstanceCount: nodeType.VMInstanceCount,
4248
vmManagedIdentity: nodeType.VMManagedIdentity,
43-
isStateless: nodeType.IsStateless,
44-
multiplePlacementGroups: nodeType.MultiplePlacementGroups,
49+
vmSecrets: nodeType.VMSecrets,
4550
vmSharedGalleryImageId: nodeType.VMSharedGalleryImageId,
46-
securityType: nodeType.SecurityType,
47-
secureBootEnabled: nodeType.SecureBootEnabled,
48-
enableNodePublicIP: nodeType.EnableNodePublicIP,
49-
natGatewayId: nodeType.NatGatewayId,
50-
vmImagePlan: nodeType.VMImagePlan)
51+
vmSize: nodeType.VMSize)
5152
{
5253
}
5354
}

src/ServiceFabric/ServiceFabric/help/New-AzServiceFabricManagedCluster.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ New-AzServiceFabricManagedCluster [-ResourceGroupName] <String> [-Name] <String>
1818
[-UpgradeMode <ClusterUpgradeMode>] [-CodeVersion <String>] [-UpgradeCadence <PSClusterUpgradeCadence>]
1919
[-ClientCertIsAdmin] -ClientCertThumbprint <String> -AdminPassword <SecureString> [-AdminUserName <String>]
2020
[-HttpGatewayConnectionPort <Int32>] [-ClientConnectionPort <Int32>] [-DnsName <String>]
21-
[-Sku <ManagedClusterSku>] [-UseTestExtension] [-ZonalResiliency] [-AsJob] [-Tag <Hashtable>]
21+
[-Sku <ManagedClusterSku>] [-UseTestExtension] [-ZonalResiliency]
22+
[-AutoGeneratedDomainNameLabelScope <String>] [-AsJob] [-Tag <Hashtable>]
2223
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2324
```
2425

@@ -29,8 +30,7 @@ New-AzServiceFabricManagedCluster [-ResourceGroupName] <String> [-Name] <String>
2930
[-ClientCertIsAdmin] -ClientCertCommonName <String> [-ClientCertIssuerThumbprint <String[]>]
3031
-AdminPassword <SecureString> [-AdminUserName <String>] [-HttpGatewayConnectionPort <Int32>]
3132
[-ClientConnectionPort <Int32>] [-DnsName <String>] [-Sku <ManagedClusterSku>] [-UseTestExtension]
32-
[-ZonalResiliency] [-AsJob] [-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
33-
[<CommonParameters>]
33+
[-ZonalResiliency] [-AutoGeneratedDomainNameLabelScope <String>] [-AsJob] [-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3434
```
3535

3636
## DESCRIPTION
@@ -128,6 +128,21 @@ Accept pipeline input: False
128128
Accept wildcard characters: False
129129
```
130130
131+
### -AutoGeneratedDomainNameLabelScope
132+
This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert.
133+
134+
```yaml
135+
Type: System.String
136+
Parameter Sets: (All)
137+
Aliases:
138+
139+
Required: False
140+
Position: Named
141+
Default value: None
142+
Accept pipeline input: False
143+
Accept wildcard characters: False
144+
```
145+
131146
### -ClientCertCommonName
132147
Client certificate common name.
133148

src/ServiceFabric/ServiceFabric/help/Set-AzServiceFabricManagedCluster.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ Set-AzServiceFabricManagedCluster [-InputObject] <PSManagedCluster> [-AsJob]
2222
```
2323
Set-AzServiceFabricManagedCluster [-ResourceGroupName] <String> [-Name] <String>
2424
[-UpgradeMode <ClusterUpgradeMode>] [-CodeVersion <String>] [-HttpGatewayConnectionPort <Int32>]
25-
[-ClientConnectionPort <Int32>] [-DnsName <String>] [-AsJob] [-Tag <Hashtable>]
26-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
25+
[-ClientConnectionPort <Int32>] [-DnsName <String>] [-AutoGeneratedDomainNameLabelScope <String>] [-AsJob]
26+
[-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
27+
[-Confirm] [<CommonParameters>]
2728
```
2829

2930
### ByNameById
3031
```
3132
Set-AzServiceFabricManagedCluster [-ResourceId] <String> [-UpgradeMode <ClusterUpgradeMode>]
3233
[-CodeVersion <String>] [-HttpGatewayConnectionPort <Int32>] [-ClientConnectionPort <Int32>]
33-
[-DnsName <String>] [-AsJob] [-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
34-
[-Confirm] [<CommonParameters>]
34+
[-DnsName <String>] [-AutoGeneratedDomainNameLabelScope <String>] [-AsJob] [-Tag <Hashtable>]
35+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
36+
[<CommonParameters>]
3537
```
3638

3739
## DESCRIPTION
@@ -79,6 +81,21 @@ Accept pipeline input: False
7981
Accept wildcard characters: False
8082
```
8183
84+
### -AutoGeneratedDomainNameLabelScope
85+
This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert.
86+
87+
```yaml
88+
Type: System.String
89+
Parameter Sets: WithParamsByName, ByNameById
90+
Aliases:
91+
92+
Required: False
93+
Position: Named
94+
Default value: None
95+
Accept pipeline input: False
96+
Accept wildcard characters: False
97+
```
98+
8299
### -ClientConnectionPort
83100
Port used for client connections to the cluster. Default: 19000.
84101

0 commit comments

Comments
 (0)