I'm using Sitecore 9.2 scaled environment on Azure, and am trying to make .Net core 2.2 projects published on azure app service, not on the same instance of Sitecore azure connects to XConnect,

I was facing some problems on finding the certificate so I posted this question and I had some help and found the solution by connecting through the below code:

public class CustomHandler : IHttpClientHandlerModifier {
    public void Process(HttpClientHandler handler) {
        X509Certificate cert = LoadYourCertificateHere();
        handler.ClientCertificateOptions = ClientCertificateOption.Manual;

then used this:

 var certificateModifier = new CertificateValidationHttpClientHandlerModifier();

Now I'm facing a new error The HTTP response was not successful: Forbidden. I think this is because the certificate is not trusted by azure or something. So, Is there a way to move the certificate to local machine/root or currentUser/root? or Can someone please advise what to do?

please note: that everything is working fine locally with .Net core but when I published the code this was the error

  • I think your issue is that you need a certificate that .netcore trusts. Core needs extra security. sitecore.stackexchange.com/questions/16122/…
    – Chris Auer
    Commented Nov 30, 2019 at 22:44
  • 1
    @ChrisAuer please note that everything is working fine locally with the same certificate and .Net core, but the problem begin when I published the code on Azure Commented Dec 1, 2019 at 8:06

1 Answer 1


I totally forgot to update the question:

According to Microsoft document the problem was that the certificate has to be signed by a trusted certificate authority.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.