I have created a WebJob in .Net Framework 4.5. This webjob is consuming a traditional WCF service which is protected by certificates ( Public/private key ). I have imported all the required certificates in my local computer and I was able to communicate with the WCF service. Below is sample code that is fetching certificate from local store.
X509Certificate2 tlsCert = X509CertificateUtil.GetCertificate(
"39834391cba4e625bab0cba7838247ec6b53d92d",
X509FindType.FindByThumbprint,
StoreName.TrustedPeople,
StoreLocation.LocalMachine,
true
);
and then use tlsCert
further to execute WCF contract.
I am not sure how to do this when I am hosting this in Azure. How do I import the certificate and access certificate store in Azure?
Note: We are not using VM to deploy WebJob in azure. we are using 'Appservice' plan to host the webjob.
Any direction how to deal with the certificates? I am trying to get it done using KeyVault, but not sure if it will work or not.