A certificate is an instrument meant to bind information regarding an entity (the subject) to their possession of a pair of asymmetric cryptographic keys, and so constitutes a core construct of public key cryptography. The keys represented by a certificate can be used for protecting data. The client and server use certificates to ensure the privacy and integrity of their communication, and to conduct mutual authentication. In Service Fabric, certificates are used to provide security and for authentication.
When a Service Fabric Cluster certificate is close to expiry, you need to update the certificate. Certificate rollover is simple if the cluster was Set up to use certificate based on common name (instead of thumbprint). Get a new certificate from a certificate authority with a new expiration date. Self-signed certificates are not support for production Service Fabric Clusters to include certificates generated during Azure portal cluster creation workflow. The new certificate must have the same common name as the older certificate issued by same Certificate Authority.
Service Fabric Cluster will automatically use the declared certificate with a later expiration date, when more than one valid certificate is installed on the virtual machine scale set. You need to upload a new certificate to a Key Vault and then install the certificate on the virtual machine scale set.
Add new certificate to Key Vault:
Get a new certificate from a Certificate Authority e.g., DigiCert, GeoTrust, Comodo etc., with a later expiration date and Upload certificate in Azure Key Vault.
*Note: Please note that here we are not promoting any Certificate Authority, this is just for your reference.
Install the certificate on the virtual machine scale set:
Before starting the process of installing the certificate on virtual machine scale set, do check the certificate issuer thumbprint of old and new certificate.
*Note: Issuer thumbprint is the thumbprint of intermediate in the certification path and not of the leaf (certificate itself). Please refer below screenshot for more clarity.
Finding the issuer thumbprint of old certificate:
Old certificate issuer thumbprint you can check from Resource Explorer (azure.com). Please follow the steps below for checking the issuer thumbprint of old certificate:
Below is the snippet of resource explorer:
"certificateCommonNames": {
"commonNames": [
{
"certificateCommonName": "[parameters('certificateCommonName')]",
"certificateIssuerThumbprint": "[parameters('certificateIssuerThumbprintList')]"
}
],
"x509StoreName": "[parameters('certificateStoreValue')]"
}
Finding the issuer thumbprint of new certificate:
For a new certificate, please install the certificate in your machine for current user and then you can check the issuer thumbprint from certification path. Please follow the steps below to check issuer thumbprint (intermediate thumbprint) for new certificate:
Based on both the issuer thumbprints:
For adding the new issuer thumbprint in cluster, please follow the below steps:
"certificateCommonNames": {
"commonNames": [
{
"certificateCommonName": "[parameters('certificateCommonName')]",
"certificateIssuerThumbprint": "[parameters('certificateIssuerThumbprintList')]"
}
],
"x509StoreName": "[parameters('certificateStoreValue')]"
}
For e.g., "certificateIssuerThumbprint": “thumbprintOld, thumbprintNew”
Installing certificate on VMSS:
Now you need to install the certificate on virtual machine scale set. Follow the steps below:
subscriptions
└───%subscription name%
└───resourceGroups
└───%resource group name%
└───providers
└───Microsoft.Compute
└───virtualMachineScaleSets
└───%virtual machine scale set name%
"vaultCertificates": [
{
"certificateUrl": "[parameters('oldCertificateUrlValue')]"
"certificateStore": "[parameters('oldCertificateValue')]",
},
{
"certificateUrl": "[parameters('newCertificateUrlValue')]"
"certificateStore": "[parameters('newCertificateValue')]"
}
]
VMSS provisioning state in Updating
VMSS provisioning state in Succeeded
NOTE: Make sure that you have repeated the above step for all the node types (Microsoft.Compute/virtualMachineScaleSets) resource definitions in your template. If you miss one of them, the certificate will not get installed on that virtual machine scale set and you will have unpredictable results in your cluster, including the cluster going down. So double check, before proceeding further.
To check if the new certificate is deployed successfully or not. Navigate to Service Fabric Explorer (SFX). Then expand any node and in the essential section, expand Health evaluations -> All and see the certificate expiry. It will be the later expiry of new certificate. Refer below screenshot:
*Note: Please don’t get confused by the thumbprint mentioned in the screenshot or on Service Fabric Explorer. As even if you are using common name-based certificate, that certificate will still have some thumbprint and Service Fabric Explorer in this section shows that thumbprint only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.