March 15, 2024

Read TLS/SSL Certificate in Azure App Service from C# Code

Recently I was updating an old .NET Core web application to .NET 8 and the code was reading a certificate as follows. private X509Certificate2 GetCertificateByThumbprint(string thumbprint){    X509Store store = new (StoreName.My, StoreLocation.CurrentUser);    store.Open(OpenFlags.ReadOnly);