How to add custom domain and SSL certificate to Azure App Service
This article explains how to create add a custom domain and SSL certificate to Azure App Service. GoDaddy is the domain registrar and ZeroSSL is the certificate provider.
Add Custom Domain
Make sure to use the domain which is under your own ownership.
- Select Custom domains from left blade of Azure App service page.
- Click on Add custom domain.
- Enter the domain on right hand blade and click validate
- Select A record or CNAME from the Hostname record type drop down. More about CNAME and A record can be found here.
- Validate the domain ownership by adding TXT record and CNAME/A record (based on the selection above) in the domain registrar. Steps to edit/add CNAME/A record in GoDaddy can be found here.
- After successful verification of domain ownership, click on Add custom domain button to add domain successfully.
Add SSL Binding
- Obtain SSL certificate. More steps on generating free SSL certificate using ZeroSSL can be found here.
- The certificate from ZeroSSL is not in .pfx format. To convert .crt to .pfx using OpenSSL, follow the answer given in this Stack Overflow question. Make sure to remember the password.
- In Azure portal →App Service → Custom domains → Click Add binding on the domain added.
- Give the domain name, Click Upload PFX Certificate.
- Upload the .pfx file and enter the password.
- After uploading, Select Private Certificate Thumbprint and TLS/SSL Type from the dropdown and Click Add Binding.
The binding will be added successfully.