I have added a PFX file as an embedded resource in an assembly to use the certificate to sign a JWT token. I load the pfx as stream and read all the bytes and using X509Certificate2 to load the private key
public X509Certificate2(byte[] rawData, string password)
Works fine on dev machine in both Debug/Release, but when deployed to azure apps ervice or a build machine i am seeing "Bad data" error.
Any help greatly appreciated. Thanks