Deleting and re-creating the SSL/domain bindings resolved the issue. It seems there was some sort of synchronization issue in the underlying Azure infrastructure.
Why is Azure App Service randomly using *.azurewebsites.net cert instead of custom cert?
Our App Service occasionally ends up serving the default *.azurewebsites.net certificate for our custom domain, instead of the certificate for our domain. There doesn't seem to be any rhyme or reason. In almost all cases, it serves the correct one, but occasionally it will serve the default one. We have a custom domain, and SNI binding set up. The Troubleshooter will generally say there are no problems, but will sometimes show the incorrect certificate for one or both of the bare domain, and the www subdomain. I have even seen it serve a page request and all related resources with the correct certificate, except for one css file in the midst of all the other requests on the same domain being served with the wrong certificate and subsequently blocked by the browser.
Any ideas where to begin?
1 additional answer
Sort by: Most helpful
-
Kenji Prahyudi 5 Reputation points
2023-04-25T14:39:35.8266667+00:00 I found the workaround, turns out when I switched the method, from "A record" to "forward to www", it works as expected. I use this method: https://learn.microsoft.com/en-us/azure/static-web-apps/apex-domain-external#forward-to-www-subdomain