Adding a Let’s Encrypt Certificate to an Azure-Hosted Website

If you host your website in Azure, you might be interested in adding SSL support via Let's Encrypt. Azure doesn't offer any functionality to automate this or make it easy, but thankfully there are plenty of useful tools in the PowerShell community to make this easy.

  1. ACMESharp - A PowerShell module to interact with Let's Encrypt.
  2. Azure PowerShell - A set of PowerShell modules to interact with Azure.

What's been missing (until now!) is the glue. So now, here's the glue: Register-LetsEncryptCertificate.ps1.

So the steps:

  1. Install-Module AcmeSharp, Azure, AzureRM.Websites
  2. Install-Script Register-LetsEncryptCertificate.ps1
  3. Register-LetsEncryptCertificate -Domain www.example.com -RegistrationEmail [email protected] -ResourceGroup exampleResourceGroup -WebApp exampleWebApp
  4. Visit https://www.example.com

Done!

 

5 Responses to “Adding a Let’s Encrypt Certificate to an Azure-Hosted Website”

  1. Dew Drop - March 22, 2017 (#2445) - Morning Dew writes:

    […] Adding a Let’s Encrypt Certificate to an Azure-Hosted Website (Lee Holmes) […]

  2. Adding a Let’s Encrypt Certificate to an Azure-Hosted Website - .NET Development & News writes:

    […] HTTPS all the Things ! https://www.leeholmes.com/blog/2017/03/21/adding-a-lets-encrypt-certificate-to-an-azure-hosted-websi… […]

  3. Ohad Schneider writes:

    Another alternative (not base on PowerShell): https://github.com/ohadschn/letsencrypt-webapp-renewer (I’m the author).

  4. Wes writes:

    This script doesn’t work for me, I get an error:

    C:\Program Files\WindowsPowerShell\Scripts\Register-LetsEncryptCertificate.ps1 : Certificate generation failed. Status is ‘invalid’, can’t continue as it is not ‘valid’. Let’s Encrypt could not retrieve the expected content from ‘www..com/.well-known/acme-challenge//index.html’

    Is this script still supposed to work?

    Thanks,
    Wes

  5. Isaac S. writes:

    Hi. Thank you very much for your script.
    I have a problem, I have executed the script and is created the token, but the verification is failed.

    In the path: /.well-known/acme-challenge/7l8AoUiU64XTPnFHXq6U2IuzCYYNNnaB57PPWWy4-IM/index.html
    There is this code:
    7l8AoUiU64XTPnFHXq6U2IuzCYYNNnaB57PPWWy4-IM.fTrcNoJ6nPoTPq0V4ICIn-x79W_62sDPY8K2T98iIR0

    It produced this output:
    Certificate generation failed. Status is ‘invalid’, can’t continue as it is not ‘valid’. Let’s Encrypt could not
    retrieve the expected content from…

    Another question … what is this for: UseUnixFileVerification?

    Thanks!!

Leave a Reply