Hi David R,
It seems like When integrating Azure Front Door with your WordPress site hosted on Azure App Service, it's essential that WordPress recognizes and utilizes the AFD endpoint as its primary URL.
That includes all internal links, redirects, and resources are correctly referenced through the AFD's custom domain, rather than the default *.azurewebsites.net domain.
The environment variables AFD_ENDPOINT and AFD_ENABLED are intended to facilitate this configuration, by updating the WP_HOME and WP_SITEURL constants in the wp-config.php file.
If the environment variables aren't reflecting the desired changes, you can manually set the WP_HOME and WP_SITEURL constants in your wp-config.php file to match your AFD custom domain.
Use an FTP client or Azure's Kudu console to navigate to your site's root directory and open the wp-config.php file, in that
replacing https://your-custom-domain.com with your actual AFD custom domain (WP_HOME and WP_SITEURL).
define('WP_HOME', 'https://your-custom-domain.com');
define('WP_SITEURL', 'https://your-custom-domain.com');
This manual configuration ensures that WordPress generates URLs and handles redirects using your custom domain.
To assure all traffic flows through Azure Front Door, configure access restrictions on your Azure App Service to accept requests only from Azure Front Door.
This enhances security and ensures consistent URL handling.
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.
Let me know if you have any further Queries.