I built a Azure web job console which is referring Windows Azure Management Libraries. I tried to authenticate my app by using public setting approach.
The program i
I would suggest starting with this blog post: http://blog.tylerdoerksen.ca/2015/11/29/pfx-certificate-files-and-azure-web-apps/. Though this blog post is about Azure Websites and not Azure Webjobs per se however I'm inclined to believe that your problem is because of this. In fact, I ran into exact same problem with Azure Websites.
However in order to use the solution outlined in the blog post, you can't use the certstring
from the publish setting file as is. Here's what you would need to do:
App_Data
folder, not sure where you will include it in case of Webjob. You can try so that it is present in the bin folder.Read this file and try to create an instance of X509 Certificate using the syntax specified in the blog post (and copied here):
var cert = new X509Certificate2(pfxFile, "myPassword", X509KeyStorageFlags.MachineKeySet);