azure-web-app-servicemsdeploy

"Could not create SSL/TLS secure channel" when deploying via MSDeply to Web App


I'm having a very weird issue: I'm deploying to an azure web app via MSDeploy from an on-prem CI/CD pipeline with Bamboo.

I get:

 27-Jun-2022 20:53:50 Verbose: Pre-authenticating to remote agent URL 'https://app-xxxxx-stg.scm.azurewebsites.net:443/msdeploy.axd?site=app-xxxxx-stg' as '$app-xxxxx-stg'.
 27-Jun-2022 20:53:50 Error: Could not complete the request to remote agent URL 'https://app-xxxx-stg.scm.azurewebsites.net/msdeploy.axd?site=app-xxxxx-stg'.
 27-Jun-2022 20:53:50 Error: The request was aborted: Could not create SSL/TLS secure channel.
 27-Jun-2022 20:53:50 Error count: 1.

What is weird is that the same deployment script works just fine with other webapps that have been created in the past (the dev and tst environments) and also fails with the same error if I try to deploy to prod environment (also just created). The environments are created via ARM template, so they are exactly the same. I've read other similar issues, but my webapp is configured to allow only TLS 1.2 min. But as mentioned, all the web apps are configured the same way, and the deployments all start from the same machine. What could be the issue? how can I solve this connection problem?

Thank you


Solution

  • Just to let everyone know: problem is solved by forcing net framework applications (like MS Deploy) to default to TLS1.2.

    As per this article: https://learn.microsoft.com/en-us/mem/configmgr/core/plan-design/security/enable-tls-1-2-client#bkmk_net

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v2.0.50727]
    "SystemDefaultTlsVersions" = dword:00000001
    "SchUseStrongCrypto" = dword:00000001
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319]
    "SystemDefaultTlsVersions" = dword:00000001
    "SchUseStrongCrypto" = dword:00000001