Skip to content

Commit 6019072

Browse files
authored
Merge pull request #3947 from chingchenmsft/release-4.0.1
Fix md file and bugs
2 parents 0ed3111 + 2437697 commit 6019072

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/AddAzureRmServiceFabricClientCertificate.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public override void ExecuteCmdlet()
5555

5656
var patchRequest = new ClusterUpdateParameters
5757
{
58-
ClientCertificateThumbprints = allCertThumbprints
58+
ClientCertificateThumbprints = allCertThumbprints,
59+
ClientCertificateCommonNames = cluster.ClientCertificateCommonNames
5960
};
6061

6162
var psCluster = SendPatchRequest(patchRequest);
@@ -76,7 +77,8 @@ public override void ExecuteCmdlet()
7677

7778
var patchRequest = new ClusterUpdateParameters
7879
{
79-
ClientCertificateCommonNames = allNewCommonNames
80+
ClientCertificateCommonNames = allNewCommonNames,
81+
ClientCertificateThumbprints = cluster.ClientCertificateThumbprints
8082
};
8183

8284
var psCluster = SendPatchRequest(patchRequest);

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/RemoveAzureRmServiceFabricClientCertificate.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public override void ExecuteCmdlet()
7979

8080
var patchRequest = new ClusterUpdateParameters
8181
{
82-
ClientCertificateThumbprints = thumbprintList
82+
ClientCertificateThumbprints = thumbprintList ,
83+
ClientCertificateCommonNames = cluster.ClientCertificateCommonNames
8384
};
8485

8586
var psCluster = SendPatchRequest(patchRequest);
@@ -128,7 +129,8 @@ public override void ExecuteCmdlet()
128129

129130
var patchRequest = new ClusterUpdateParameters
130131
{
131-
ClientCertificateCommonNames = commonNames
132+
ClientCertificateCommonNames = commonNames,
133+
ClientCertificateThumbprints = cluster.ClientCertificateThumbprints
132134
};
133135

134136
var psCluster = SendPatchRequest(patchRequest);

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/ServiceFabricClientCertificateBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected List<ClientCertificateThumbprint> ParseArgumentsForThumbprint()
9696
{
9797

9898
if ((this.AdminClientThumbprint == null || !this.AdminClientThumbprint.Any()) &&
99-
(this.ReadonlyClientThumbprint == null) || !this.ReadonlyClientThumbprint.Any())
99+
(this.ReadonlyClientThumbprint == null || !this.ReadonlyClientThumbprint.Any()))
100100
{
101101
throw new PSArgumentException(
102102
"Both AdminClientThumbprints and ReadonlyClientThumbprints are empty");

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/ServiceFabricCmdletBase.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -460,22 +460,19 @@ protected string GetCurrentUserObjectId()
460460

461461
objectId = user.ObjectId;
462462
}
463-
catch (GraphErrorException e)
463+
catch (GraphErrorException)
464464
{
465-
if (e.Body != null && e.Body.Code == "Authorization_RequestDenied")
466-
{
467-
var user = GraphClient.ServicePrincipals.List(
468-
new Rest.Azure.OData.ODataQuery<ServicePrincipal>(
469-
string.Format("$filter=servicePrincipalNames/any(c: c eq '{0}')", DefaultContext.Account.Id))
470-
).FirstOrDefault();
471-
472-
if (user == null)
473-
{
474-
return null;
475-
}
465+
var user = GraphClient.ServicePrincipals.List(
466+
new Rest.Azure.OData.ODataQuery<ServicePrincipal>(
467+
string.Format("$filter=servicePrincipalNames/any(c: c eq '{0}')", DefaultContext.Account.Id))
468+
).FirstOrDefault();
476469

477-
objectId = user.ObjectId;
470+
if (user == null)
471+
{
472+
return null;
478473
}
474+
475+
objectId = user.ObjectId;
479476
}
480477

481478
return objectId;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Use **Add-AzureRmServiceFabricNode** to add nodes to the specific node type. You
2323

2424
### Example 1
2525
```
26-
PS c:> Add-AzureRmServiceFabricNode -ResourceGroupName 'Group1' -Name 'Contoso01SFCluster' -NumberOfNodesToAdd 2 -NodeTypeName 'nt1''
26+
PS c:> Add-AzureRmServiceFabricNode -ResourceGroupName 'Group1' -Name 'Contoso01SFCluster' -NumberOfNodesToAdd 2 -NodeTypeName 'nt1'
2727
```
2828

2929
This command will add 2 nodes to the node type 'n1'.

src/ResourceManager/ServiceFabric/Commands.ServiceFabric/help/New-AzureRmServiceFabricCluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ $pfxfolder="c:\Mycertificates\"
6161
6262
Write-Output "create cluster in " $clusterloc "subject name for cert " $subname "and output the cert into " $pfxfolder
6363
64-
New-AzureRmServiceFabricCluster -ResourceGroupName $RGname -Location $clusterloc -ClusterSize 3 -VmPassword $pwd -CertificateSubjectName $subname -PfxOutputFolder $pfxfolder -CertificatePassword $pwd
64+
New-AzureRmServiceFabricCluster -ResourceGroupName $RGname -Location $clusterloc -ClusterSize 3 -VmPassword $pwd -CertificateSubjectName $subname -CertificateOutputFolder $pfxfolder -CertificatePassword $pwd
6565
```
6666

6767
This command specifies only the cluster size, the cert subject name, and the OS to deploy a cluster.

0 commit comments

Comments
 (0)