Azure typically uses pfx files for service principal authentication. These are PKCS#12 files so just try and read a cert file as such if we can't already read it as PEM.