I have site in Azure Websites (not Hosted Service) and I need processing .pfx certificates with private key there.
var x509Certificate2 = new X509Certificat
I guess you found a workaround, but if others are struggling with this, I found the answer to this in another SO question:
How can constructing an X509Certificate2 from a PKCS#12 byte array throw CryptographicException("The system cannot find the file specified.")?
The magic is specifying the X509KeyStorageFlags storage flags. Example:
var myCertificae = new X509Certificate2(
certificateData,
securePasswordString,
X509KeyStorageFlags.MachineKeySet |
X509KeyStorageFlags.PersistKeySet |
X509KeyStorageFlags.Exportable);