@PaulMarsh-3273 Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused
A custom domain and its subdomain can be associated with only a single endpoint at a time. However, you can use different subdomains from the same custom domain for different Azure service endpoints by using multiple CNAME records. You can also map a custom domain with different subdomains to the same CDN endpoint.
You can use different subdomains in the same endpoint. Alternatively, I think you also could create two endpoints, one is for the root domain without www, the other is for a subdomain with www.
Please refer to this article: https://learn.microsoft.com/en-us/azure/cdn/cdn-map-content-to-custom-domain#create-a-cname-dns-record
Also, you can implement redirection in your server or CDN.
When someone tries to access example.com, you can do a 301 by sending http://www.example.com in the location header.
Hope this helps!
Kindly let us know if the above helps or you need further assistance on this issue.
Please don’t forget to "Accept the answer" wherever the information provided helps you, this can be beneficial to other community members.