Skip to content
Mate Gelei-Szego
Mate Gelei-Szego

Making huge cloud deployments a little more effective.

  • Home
  • About me
Mate Gelei-Szego

Making huge cloud deployments a little more effective.

Let’s Encrypt Certbot manual mode with Azure Key Vault

Posted on July 13, 2023April 23, 2025

Yes, yes, I know, certbot should be automated.

Most of the time, I use Certbot to generate and renew my Let’s Encrypt certificates in an automatic way, i.e. through Github Actions or something. However, every now and then I need to generate a certificate manually, usually for ephemeral purposes.

To do that I use the manual mode of Certbot with DNS verification, which requires you to create a DNS TXT record with a specific value. This is a bit cumbersome, but it works (or there might be a DNS plugin available for your provider). However the generated certificate cannot be directly imported to Azure Key Vault which I usually use for my projects.

For the purpose of this, note that the DNS challenge is not important, but in some scenarios it’s more feasible, for example one time I had to generate a certificate for a domain that was pointing to an Azure CDN endpoint, which in turn pointed to a https-only Azure Storage account.

This post is more of a note to self, but maybe it helps someone else as well. Also, the commands were for macOS, so your mileage may vary.

Generate certificate

Generating the certificate is pretty straightforward, but make sure you pick RSA keys, as Azure Key Vault does not support ECDSA keys yet.

sudo certbot certonly -d example.com,www.example.com --manual --preferred-challenges dns --key-type rsa

Convert certificate to PFX

The next step is to convert the certificate to a PFX file, which can be imported to Azure Key Vault. This can be done with the following command:

sudo openssl pkcs12 -export -in /etc/letsencrypt/live/example.com/fullchain.pem -inkey /etc/letsencrypt/live/example.com/privkey.pem -out ./export.pfx

The resulting PFX file can be imported to Azure Key Vault, thus making it usable for Azure CDN and other Azure services.

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email

Post navigation

Previous post
Next post

Mate Gelei-Szego

Experienced cloud engineer with a background in software development, service management and finance.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • On case-sensitive file systems
  • Unlocking Ubuntu LUKS2 encryption automatically at boot
  • Install RSAT via Powershell
  • Azure DevOps – build pipeline billing extravaganza
  • Quickstart – Azure AD B2C authentication in ASP.NET Core MVC

Categories

  • Azure
  • C# / .NET
  • Note to self
  • Random
©2025 Mate Gelei-Szego | WordPress Theme by SuperbThemes