diff --git a/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/ChangeLog.md b/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/ChangeLog.md index 4c5d7ef19f43..46bcdac8dde7 100644 --- a/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/ChangeLog.md +++ b/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/ChangeLog.md @@ -20,7 +20,9 @@ ## Current Release * Fix add certificate to Linux Vmss. -* Fix `Add-AzureRmServiceFabricClusterCertificate` to display exception correctly (Azure/service-fabric-issues#1054). +* Fix `Add-AzureRmServiceFabricClusterCertificate` + - Using correct thumbprint from new certificate (Azure/service-fabric-issues#932). + - Display exception correctly (Azure/service-fabric-issues#1054). * Fix `Update-AzureRmServiceFabricDurability` to update cluster configuration before starting Vmss CreateOrUpdate operation. diff --git a/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/ServiceFabricClusterCertificateCmdlet.cs b/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/ServiceFabricClusterCertificateCmdlet.cs index 15405f42c4d4..df47c7460e2e 100644 --- a/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/ServiceFabricClusterCertificateCmdlet.cs +++ b/src/ResourceManager/ServiceFabric/Commands.ServiceFabric/Commands/ServiceFabricClusterCertificateCmdlet.cs @@ -632,7 +632,11 @@ private string GetThumbprintFromSecret(string secretUrl) jsonBlob.Password, X509KeyStorageFlags.Exportable); - return certCollection[0].Thumbprint; + var lastCert = certCollection.Count > 0 ? certCollection[certCollection.Count - 1] : null; + if (lastCert?.Thumbprint != null) + { + return lastCert.Thumbprint; + } } } }