Unable to read the X509Certificate2 private key RRS feed

  • Question

  • Hi,

    I am using an X509Certificate2 [PFX] and I am getting this certificate read from the My / CurrentUser Store in Microsoft Azure AppService [Not Web Role]. In case of the application trying to restart after a idle timeout, it seems that the certificate looses its private key and I am not able to decrypt the messages.

    Is there any specific change to be done in the Azure AppService other than uploading the certificate to make sure that the certificate's Private key is readable internally.

    Even tried to use a private blob for this and got the "Key Set Not Found" exception in both the Certificate Store & the BLOB Storage. 

    I am not sure why the private key is lost all of a sudden and why would the exception be thrown. Kindly suggest a fail-safe method. I assume that even with this case, opting for use of a Azure Key Vault would not stop the errors from coming up.

    Tuesday, May 2, 2017 4:52 AM

All replies

  • Hi d.saravanan,

    Thank you for posting here.

    According to your question is more related to Azure web app, you could post a new thread in Azure and ASP.NET forum for suitable support.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

    Thanks for your understanding and cooperation.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Tuesday, May 2, 2017 8:32 AM
  • Oopsie,

    My Microsoft Authentication failed in that site, guess that's a completely different model. Finally got it working with Google Auth. 

    I am reposting this question there. Thanks @Wendy

    Tuesday, May 2, 2017 9:33 AM