In this article we are going to setup a custom domain with SSL certificates with let's encrypt.
Login to your Azure portal and go to your App Service.
Select the Custom domain on the side menu. Select "On" in the HTTPS only settings.
Click on the "Add custom domain" link.
Enter your custom domain and press the "Validate" button.
Switch over to your hosting provider and edit the A records and enter in the specified IP address.
Add a "TXT" record with your-domain.azurewebsite.net.
Press the "Validate" button again to verify you have ownership of the domain.
With your favorite browser browse to the website https://www.sslforfree.com/.
Select Manual Verification (DNS) and press the "Manual Verification" button.
Enter the TXT Records for the web site specified by SSL For Free
Enter the TXT records for the www prefix for the web site specified by SSL For Free.
After the verification successful, press the "Download SSL Certificates" button.
Either cut and paste the specified information or better yet download retrieve the information from the downloaded files.
Convert the SSL Certificates to PFX Certificate (PKCS#12) format.
Press the "Add custom domain" link. Enter the Custom domain and then press the "Add custom domain" button.
Select you custom domain from the combo box pull down. and then press the "Upload PFX Certificate".
Enter the certificate password and press the "Upload" button.
Select "SNI SSL" from the "TLS/SSL Type" and press the "Add Binding" button.
With your favorite browser, browse to your custom domain.
Click on the Add custom domain and Validate button. Notice you need to verify domain ownership.
Enter a "CNAME" for the azure website.
if desired, add another custom domain for the www prefix. Click on the Add custom domain with the www prefix and press validate.
Select custom domain, "SNI SSL" from the "TLS/SSL Type" and press the "Add Binding" button.
Now both domains are secure with SSL Certificates.
With your favorite browser, browse to your site and test.
With the free certificates from Let's Encrypt you can have a secure site.
The complete source code is located here.