Combining a key and certificate into a .pfx file

If you want to use SSL with your site in Azure you need to have a .pfx file.

We Apache you most likely have a certificate and a private key. I am using certificate from Letsencrypt.

Using openssl you can generate the .pfx file like this:

openssl pkcs12 -export -out /tmp/certificate.pfx
-inkey /etc/letsencrypt/live/yourdomain.tld/privkey.pem
-in /etc/letsencrypt/live/yourdomain.tld/cert.pem
-certfile /etc/letsencrypt/live/yourdomain.tld/chain.pem

Replace yourdomain.tld with your actual domain name.
You will be asked for a password to protect the .pfx file