I have site in Azure Websites (not Hosted Service) and I need processing .pfx certificates with private key there.
var x509Certificate2 = new X509Certificat
In Azure Websites / Web App / Mobile App - you have to use App Service Plan that allwos you to import SSL certificate - so it shoud not be a Free or Shared. You can import not only SSL certificate, but also for an example code signing cerificate and use it in signtool or from PowerShell.
I used this method in https://vmplace.eu/
If you try to use a Free or Shared plan you receive error - so in Azure in these Plans there is other version of .NET framework.
You can refer to this project also: https://github.com/onovotny/SignService