I have an Azure WebJob which when run locally works fine, yet when run in Azure it throws an exception. The WebJob is making an external call over HTTPS which in Azure produces this exception:
System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.HttpWebRequest.GetResponse()
I also tried setting the security protocol to TLS using ServicePointManager
but this too had no effect on the exception. Here's a snippet of my code.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
var request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
Does Azure block WebJobs from internet access or am I doing something wrong?