Adding a Let’s Encrypt Certificate to an Azure-Hosted Website
Tuesday, 21 March 2017
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.
- ACMESharp - A PowerShell module to interact with Let's Encrypt.
- 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:
- Install-Module AcmeSharp, Azure, AzureRM.Websites
- Install-Script Register-LetsEncryptCertificate.ps1
- Register-LetsEncryptCertificate -Domain www.example.com -RegistrationEmail [email protected] -ResourceGroup exampleResourceGroup -WebApp exampleWebApp
- Visit https://www.example.com
Done!
No. 1 — March 22nd, 2017 at 1:12 pm
[…] Adding a Let’s Encrypt Certificate to an Azure-Hosted Website (Lee Holmes) […]
No. 2 — March 23rd, 2017 at 4:38 pm
[…] HTTPS all the Things ! https://www.leeholmes.com/blog/2017/03/21/adding-a-lets-encrypt-certificate-to-an-azure-hosted-websi… […]
No. 3 — August 27th, 2017 at 1:17 am
Another alternative (not base on PowerShell): https://github.com/ohadschn/letsencrypt-webapp-renewer (I’m the author).
No. 4 — October 16th, 2017 at 3:54 pm
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
No. 5 — February 12th, 2018 at 9:13 am
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!!