We have an application hosted on Azure App Service, it requires a few PowerShell WebJobs to run in order to operate, these make calls to a Tableau Server API.
Currently these calls are using TLS v1.0, we would like at least TLS v1.2. The web application is set to use 1.2 in TLS/SSL settings, however this is not reflected on the WebJob side of things.
I've tried running this in the Kudu console, with no persistent luck and in varying parts of the scripts, with the same amount of failure, the request still us TLSv1.
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
This does work when running the scripts through a local Windows VM, which leads me to beleive it's a App Service limitation.
Does anyone know how to change what TLS version the WebJobs use or is this a limitation with App Service?
CodePudding user response:
I don't think this is limitation of azure app service. Lets understand how and where to set TLS configuration.
- when you set TLS 1.2 on app services that is for any request coming to app services, it could be web job or app service.
- when you make outbound call from web job then you need to specify the TLS version explicitly otherwise it completely depends on framework version or SDK your web job is using.
Important please note that when you execute any powershell command let it completely depends on that powershell process and environment configuration for this process. I would suggest you to please add below code before executing any powershell command let:
$TLS12Protocol = [System.Net.SecurityProtocolType] 'Tls12' [System.Net.ServicePointManager]::SecurityProtocol = $TLS12Protocol
CodePudding user response:
How to update the TLS version in Azure Web App-
Azure Webapp > TLS/SSL setting
In addition to this use @Rohit's PS code at the webjob level.