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

Simone Chiaretta 21 Reputation points
2022-06-27T21:06:25.343+00:00

I'm having a very weird issue:
I'm deploying to an azure webapp 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-xxxxx-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 webapp that have been created in the past (dev and tst) but also fails with the same error if I try to deploy to prd.
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 deployment all start from the same machine.
What could be the issue? how can I solve this connection problem?

Thank you

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

Accepted answer
  1. J Hernandez Colomina 91 Reputation points
    2022-07-08T13:02:10.377+00:00

    We found a solution!
    This article worked for us:
    https://learn.microsoft.com/en-us/mem/configmgr/core/plan-design/security/enable-tls-1-2-client

    After adding these keys to the agent running the deployment it worked!

    [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

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2022-07-13T05:42:22.323+00:00

    Apologies for the delay. While we're still working with SimoneChiaretta-1860 offline.

    If you’re leveraging self hosted agent/custom agent for DevOps pipeline deployment. Kindly ensure that the agent has >TLS1.2 installed and then check.
    Self hosted agent connected to site using 1.0 or 1.1, we may encounter this error.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.