Can not change default domain in Azure App Container

Athanasios Kalavritinos 0 Reputation points
2023-09-16T11:22:26.0533333+00:00

Hey there,

I'm new to Azure, this is my first install.

I recently migrated my Wordpress to Azure using "WordPress on App Service" from market place.

I have everything going except my default domain is "myname.azurewebsites.net"

I added the custom domains and they have the Green Tick so all good.

However as per the documentation I do not have the option to change the default domain.

I can't see the "Set Default" button

https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain-default#set-a-default-domain

What could be the issue?

P.S - My DNS is though Cloudflare

Cheers

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

3 answers

Sort by: Most helpful
  1. TP 145.5K Reputation points Volunteer Moderator
    2023-09-16T11:44:55.69+00:00

    Hi,

    What you are seeing is normal. You are looking at documentation for Azure Static Web Apps, which is a different service than App Service. There is no "Set Default" capability on App Service.

    Have you modified DNS entries so that requests to your FQDN are pointing to your app service?

    -TP

    1 person found this answer helpful.

  2. Lex Li 6,037 Reputation points
    2023-09-17T02:58:49.5166667+00:00

    It's natural for a web app on Azure to be accessible via multiple domains, including myname.azurewebsites.net and your own custom domain(s).

    For WordPress you should use its "Site Address (URL)" to enforce a domain name that you prefer. Then all incoming requests from other domains will be redirected by WordPress itself, https://wordpress.org/documentation/article/changing-the-site-url/

    BTW, like the others commented, Azure App Service and Azure Static Web Apps are different products, so documentation of the latter does not apply to the former.

    1 person found this answer helpful.
    0 comments No comments

  3. SnehaAgrawal-MSFT 22,721 Reputation points Moderator
    2023-09-18T10:05:54.7333333+00:00

    @Athanasios Kalavritinos Thanks for reaching here! If using using IIS.

    To address this issue, consider the following steps:

    1. Verify DNS Settings: Ensure that your custom domain is correctly configured to point to your Azure App Services site. To do this, refer to the detailed instructions in the "Create the DNS records" section. Additionally, if you are unsure about the correct configuration, you can follow the steps outlined in "Map an existing custom DNS name to Azure App Service."
    2. WordPress Site Setup: During the setup of your WordPress site, you initially choose the site domain, which becomes the primary address used throughout the site. Adjusting "Site Address (URL)" in WordPress: To modify the address users type in their browsers to access your WordPress blog, follow these steps:

    a. Go to "Settings" in the WordPress admin area.

    b. Select "General" from the menu.

    c. Look for the "Site Address (URL)" field on the screen.

    d. Update the URL to the desired address for your WordPress blog.

    e. Save the changes.

    User's image

    User's image

    For Linux-

    You may have to follow the steps mentioned in this blog to update the Nginx configuration file to redirect your users from azurewebsites.net & to your custom domain.

    1. Go to Azure Portal, open a new SSH session. (https://<your-site-name>.scm.azurewebsites.net/webssh/host)
    2. Update Nginx Default.conf - Server Block (Edit- file is under /etc/nginx/conf.d/default.conf)
    3. Update Nginx Default.conf - Location Block
    4. Save Changes
    5. Use command nginx -s reload to restart the Nginx Service & load the new configuration so that your redirects should be working as expected.

    Hope this helps. Let us know.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.