If you’re using Azure CDN and need any form of CI/CD, you will be mucking around with custom certs.
There’s currently no documented way to apply custom certs to custom domains. The below is how you acheive that (with a cert. stored in keyvault):
OR! Don’t go alone, take this:
Auth module below:
(You will have to edit certain things for your environment)