I have site in Azure Websites (not Hosted Service) and I need processing .pfx certificates with private key there.
var x509Certificate2 = new X509Certificat
Azure Websites run in a shared environment. I am assuming that the constructor for the certificate is attempting to create some temporary information on the instance and it does not have permission to.
You may have to upgrade to a hosted service in order to run in an elevated context and perform this work.
Also, have you validated that the password is correct? If it doesn't require a password, you at least have to pass string.Empty to the constructor. Passing in a NULL value would also cause this exception.