Skip to content

Commit 0a865b4

Browse files
committed
fix cred issue and update md file
1 parent b1ccea6 commit 0a865b4

File tree

11 files changed

+135
-533
lines changed

11 files changed

+135
-533
lines changed

src/ResourceManager/ServiceFabric/Commands.ServiceFabric.Test/Resources/parameters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"value": "username"
1313
},
1414
"adminPassword": {
15-
"value": "User@123"
15+
"value": ""
1616
},
1717
"vmImagePublisher": {
1818
"value": "MicrosoftWindowsServer"

src/ResourceManager/ServiceFabric/Commands.ServiceFabric.Test/ScenarioTests/Common.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ function Get-ValueName
135135
return '5000'
136136
}
137137

138-
function Get-VmPassword
138+
function Get-VmPwd
139139
{
140-
return "User@12345123"
140+
$length = 10
141+
$allowedCharacters = "abcdefghijklmnopqrstuvwxyz0123456789".ToCharArray()
142+
$myRandomString = -join (Get-Random -Count $length -InputObject $allowedCharacters)
143+
return "$myRandomString"
141144
}

src/ResourceManager/ServiceFabric/Commands.ServiceFabric.Test/ScenarioTests/TestServiceFabric.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function Test-AddAzureRmServiceFabricNodeType
104104

105105
$clusters = Get-AzureRmServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName
106106
$count = $clusters[0].NodeTypes.Count
107-
$vmPassword = ConvertTo-SecureString -Force -AsPlainText -String Get-VmPassword
107+
$vmPassword = ConvertTo-SecureString -Force -AsPlainText -String Get-VmPwd
108108
$cluster = Add-AzureRmServiceFabricNodeType -Capacity 1 -VmUserName username -VmPassword $vmPassword -NodeType $newNodeTypeName `
109109
-ClusterName $clusterName -ResourceGroupName $resourceGroupName
110110
$clusters = Get-AzureRmServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName

src/ResourceManager/ServiceFabric/Commands.ServiceFabric.Test/SessionRecords/Microsoft.Azure.Commands.ServiceFabric.Test.ScenarioTests.TestServiceFabric/TestNewAzureRmServiceFabricCluster.json

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

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/AddAzureRmServiceFabricApplicationCertificate.cs

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

15-
using System;
1615
using System.Collections.Generic;
1716
using System.Linq;
1817
using System.Management.Automation;
19-
using System.Threading;
2018
using System.Threading.Tasks;
2119
using Microsoft.Azure.Commands.ServiceFabric.Common;
2220
using Microsoft.Azure.Commands.ServiceFabric.Models;

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/help/Add-AzureRmServiceFabricApplicationCertificate.md

Lines changed: 38 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,48 @@ schema: 2.0.0
77
# Add-AzureRmServiceFabricApplicationCertificate
88

99
## SYNOPSIS
10-
Add an certificate which will be used as application certificate
10+
Add a new certificate to the Virtual Machine Scale Set(s) that make up the cluster. The certificate is intended to be used as an application certificate.
1111

1212
## SYNTAX
1313

1414
### ByExistingKeyVault
1515
```
1616
Add-AzureRmServiceFabricApplicationCertificate [-ResourceGroupName] <String> [-Name] <String>
17-
-SecretIdentifier <String> [-CertificateThumprint <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
-SecretIdentifier <String> [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
### ByNewPfxAndVaultName
2121
```
2222
Add-AzureRmServiceFabricApplicationCertificate [-ResourceGroupName] <String> [-Name] <String>
23-
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] [-PfxOutputFolder <String>]
24-
-CertificateSubjectName <String> [-WhatIf] [-Confirm] [<CommonParameters>]
23+
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] [-CertificateOutputFolder <String>]
24+
[-CertificatePassword <SecureString>] -CertificateSubjectName <String> [-WhatIf] [-Confirm]
25+
[<CommonParameters>]
2526
```
2627

2728
### ByExistingPfxAndVaultName
2829
```
2930
Add-AzureRmServiceFabricApplicationCertificate [-ResourceGroupName] <String> [-Name] <String>
30-
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] -PfxSourceFile <String>
31+
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] -CertificateFile <String>
3132
[-CertificatePassword <SecureString>] [-WhatIf] [-Confirm] [<CommonParameters>]
3233
```
3334

3435
## DESCRIPTION
35-
The **Add-AzureRmServiceFabricApplicationCertificate** installs the certificate to the all nodetypes in the cluster, either from existing Azure key vault
36-
or creating an new Azure key vault using existing certificate provided or from an new self signed certificate created
36+
Use **Add-AzureRmServiceFabricApplicationCertificate** to install a certificate to all nodes in the cluster.
37+
You can specify a certificate you already have or have the system generate an new one for you, and upload it to an new or existing Azure key vault.
3738

3839
## EXAMPLES
3940

4041
### Example 1
4142
```
42-
PS c:> Add-AzureRmServiceFabricApplicationCertificate -ResourceGroupName 'Group1' -ClusterName 'Contoso01SFCluster' -SecretUrl 'https://contoso03vault.vault.azure.net/secrets/contoso03vaultrg/7f7de9131c034172b9df37ccc549524f'
43-
-CertificateThumprint 5F3660C715EBBDA31DB1FFDCF508302348DE8E7A
43+
PS c:> Add-AzureRmServiceFabricApplicationCertificate -ResourceGroupName 'Group1' -ClusterName 'Contoso01SFCluster' -SecretIdentifier 'https://contoso03vault.vault.azure.net/secrets/contoso03vaultrg/7f7de9131c034172b9df37ccc549524f'
4444
```
4545

46-
This command will add a certificate from existing Azure key vault to all node types of the cluster named myCluster
46+
This command will add a certificate from existing Azure key vault to all node types of the cluster named Contoso01SFCluster
4747

4848
### Example 2
4949
```
5050
PS c:\> $pwd = ConvertTo-SecureString -String "123" -AsPlainText -Force
51-
PS C:\> Add-AzureRmServiceFabricApplicationCertificate -ResourceGroupName 'Group2' -ClusterName 'Contoso02SFCluster' -KeyVaultName 'Contoso02Vault' -KeyVaultResouceGroupName 'Contoso02VaultRg'
52-
-PfxDestinationFile 'c:\newcert.pfx' -Password $pwd -CertificateDnsName 'Contoso.com''
51+
PS C:\> Add-AzureRmServiceFabricApplicationCertificate -ResourceGroupName 'Group2' -ClusterName 'Contoso02SFCluster' -KeyVaultName 'Contoso02Vault' -KeyVaultResouceGroupName 'Contoso02VaultRg'
5352
```
5453

5554
This command will add certificate by creating an new self signed certificate and uploading to Azure key vault, then installs to all node types of the cluster
@@ -61,7 +60,7 @@ The password of the pfx file
6160

6261
```yaml
6362
Type: SecureString
64-
Parameter Sets: ByExistingPfxAndVaultName
63+
Parameter Sets: ByNewPfxAndVaultName, ByExistingPfxAndVaultName
6564
Aliases: CertPassword
6665

6766
Required: False
@@ -86,21 +85,6 @@ Accept pipeline input: True (ByValue)
8685
Accept wildcard characters: False
8786
```
8887
89-
### -CertificateThumprint
90-
The thumprint for the Azure key vault secret
91-
92-
```yaml
93-
Type: String
94-
Parameter Sets: ByExistingKeyVault
95-
Aliases: Thumbprint
96-
97-
Required: False
98-
Position: Named
99-
Default value: None
100-
Accept pipeline input: True (ByValue)
101-
Accept wildcard characters: False
102-
```
103-
10488
### -Confirm
10589
Prompts you for confirmation before running the cmdlet.
10690
@@ -159,34 +143,6 @@ Accept pipeline input: True (ByPropertyName)
159143
Accept wildcard characters: False
160144
```
161145
162-
### -PfxOutputFolder
163-
The folder path of the new Pfx file to be created```yaml
164-
Type: String
165-
Parameter Sets: ByNewPfxAndVaultName
166-
Aliases: Destination
167-
168-
Required: False
169-
Position: Named
170-
Default value: None
171-
Accept pipeline input: True (ByValue)
172-
Accept wildcard characters: False
173-
```
174-
175-
### -PfxSourceFile
176-
The existing Pfx file path
177-
178-
```yaml
179-
Type: String
180-
Parameter Sets: ByExistingPfxAndVaultName
181-
Aliases: Source
182-
183-
Required: True
184-
Position: Named
185-
Default value: None
186-
Accept pipeline input: True (ByValue)
187-
Accept wildcard characters: False
188-
```
189-
190146
### -ResourceGroupName
191147
Specifies the name of the resource group.
192148
@@ -232,6 +188,32 @@ Accept pipeline input: False
232188
Accept wildcard characters: False
233189
```
234190
191+
### -CertificateFile
192+
The existing certificate file path```yaml
193+
Type: String
194+
Parameter Sets: ByExistingPfxAndVaultName
195+
Aliases: Source
196+
197+
Required: True
198+
Position: Named
199+
Default value: None
200+
Accept pipeline input: True (ByValue)
201+
Accept wildcard characters: False
202+
```
203+
204+
### -CertificateOutputFolder
205+
The folder path of the new certificate to be created```yaml
206+
Type: String
207+
Parameter Sets: ByNewPfxAndVaultName
208+
Aliases: Destination
209+
210+
Required: False
211+
Position: Named
212+
Default value: None
213+
Accept pipeline input: True (ByValue)
214+
Accept wildcard characters: False
215+
```
216+
235217
### CommonParameters
236218
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).
237219

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/help/Add-AzureRmServiceFabricClusterCertificate.md

Lines changed: 32 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@ Add a secondary cluster certificate to the cluster
1414
### ByExistingKeyVault
1515
```
1616
Add-AzureRmServiceFabricClusterCertificate [-ResourceGroupName] <String> [-Name] <String>
17-
-SecretIdentifier <String> [-CertificateThumprint <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
-SecretIdentifier <String> [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
### ByNewPfxAndVaultName
2121
```
2222
Add-AzureRmServiceFabricClusterCertificate [-ResourceGroupName] <String> [-Name] <String>
23-
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] [-PfxOutputFolder <String>]
24-
-CertificateSubjectName <String> [-WhatIf] [-Confirm] [<CommonParameters>]
23+
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] [-CertificateOutputFolder <String>]
24+
[-CertificatePassword <SecureString>] -CertificateSubjectName <String> [-WhatIf] [-Confirm]
25+
[<CommonParameters>]
2526
```
2627

2728
### ByExistingPfxAndVaultName
2829
```
2930
Add-AzureRmServiceFabricClusterCertificate [-ResourceGroupName] <String> [-Name] <String>
30-
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] -PfxSourceFile <String>
31+
[-KeyVaultResouceGroupName <String>] [-KeyVaultName <String>] -CertificateFile <String>
3132
[-CertificatePassword <SecureString>] [-WhatIf] [-Confirm] [<CommonParameters>]
3233
```
3334

@@ -62,7 +63,7 @@ The password of the pfx file
6263

6364
```yaml
6465
Type: SecureString
65-
Parameter Sets: ByExistingPfxAndVaultName
66+
Parameter Sets: ByNewPfxAndVaultName, ByExistingPfxAndVaultName
6667
Aliases: CertPassword
6768

6869
Required: False
@@ -87,21 +88,6 @@ Accept pipeline input: True (ByValue)
8788
Accept wildcard characters: False
8889
```
8990
90-
### -CertificateThumprint
91-
The thumprint for the Azure key vault secret
92-
93-
```yaml
94-
Type: String
95-
Parameter Sets: ByExistingKeyVault
96-
Aliases: Thumbprint
97-
98-
Required: False
99-
Position: Named
100-
Default value: None
101-
Accept pipeline input: True (ByValue)
102-
Accept wildcard characters: False
103-
```
104-
10591
### -KeyVaultName
10692
Azure key vault name
10793
@@ -145,34 +131,6 @@ Accept pipeline input: True (ByPropertyName)
145131
Accept wildcard characters: False
146132
```
147133
148-
### -PfxOutputFolder
149-
The folder path of the new Pfx file to be created```yaml
150-
Type: String
151-
Parameter Sets: ByNewPfxAndVaultName
152-
Aliases: Destination
153-
154-
Required: False
155-
Position: Named
156-
Default value: None
157-
Accept pipeline input: True (ByValue)
158-
Accept wildcard characters: False
159-
```
160-
161-
### -PfxSourceFile
162-
The existing Pfx file path
163-
164-
```yaml
165-
Type: String
166-
Parameter Sets: ByExistingPfxAndVaultName
167-
Aliases: Source
168-
169-
Required: True
170-
Position: Named
171-
Default value: None
172-
Accept pipeline input: True (ByValue)
173-
Accept wildcard characters: False
174-
```
175-
176134
### -ResourceGroupName
177135
Specifies the name of the resource group.
178136
@@ -233,6 +191,32 @@ Accept pipeline input: False
233191
Accept wildcard characters: False
234192
```
235193
194+
### -CertificateFile
195+
The existing certificate file path```yaml
196+
Type: String
197+
Parameter Sets: ByExistingPfxAndVaultName
198+
Aliases: Source
199+
200+
Required: True
201+
Position: Named
202+
Default value: None
203+
Accept pipeline input: True (ByValue)
204+
Accept wildcard characters: False
205+
```
206+
207+
### -CertificateOutputFolder
208+
The folder path of the new certificate to be created```yaml
209+
Type: String
210+
Parameter Sets: ByNewPfxAndVaultName
211+
Aliases: Destination
212+
213+
Required: False
214+
Position: Named
215+
Default value: None
216+
Accept pipeline input: True (ByValue)
217+
Accept wildcard characters: False
218+
```
219+
236220
### CommonParameters
237221
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).
238222

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/help/Add-AzureRmServiceFabricNodeType.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Add a node type to the existing cluster
1313

1414
```
1515
Add-AzureRmServiceFabricNodeType [-ResourceGroupName] <String> [-Name] <String> -NodeType <String>
16-
-Capacity <Int32> -VmUserName <String> -VmPassword <SecureString> [-Sku <String>] [-Tier <String>] [-WhatIf]
16+
-Capacity <Int32> -VmUserName <String> -VmPassword <SecureString> [-VmSku <String>] [-Tier <String>] [-WhatIf]
1717
[-Confirm] [<CommonParameters>]
1818
```
1919

@@ -102,21 +102,6 @@ Accept pipeline input: True (ByPropertyName)
102102
Accept wildcard characters: False
103103
```
104104
105-
### -Sku
106-
The sku name
107-
108-
```yaml
109-
Type: String
110-
Parameter Sets: (All)
111-
Aliases:
112-
113-
Required: False
114-
Position: Named
115-
Default value: None
116-
Accept pipeline input: True (ByValue)
117-
Accept wildcard characters: False
118-
```
119-
120105
### -Tier
121106
Tier
122107
@@ -177,6 +162,19 @@ Accept pipeline input: False
177162
Accept wildcard characters: False
178163
```
179164
165+
### -VmSku
166+
The sku name```yaml
167+
Type: String
168+
Parameter Sets: (All)
169+
Aliases:
170+
171+
Required: False
172+
Position: Named
173+
Default value: None
174+
Accept pipeline input: True (ByValue)
175+
Accept wildcard characters: False
176+
```
177+
180178
### CommonParameters
181179
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).
182180

0 commit comments

Comments
 (0)