Deploying a website hosted by Azure on a domain provided by another organization

Ke Li 0 Reputation points
2024-01-17T06:28:27.0733333+00:00

Hi!

I have deployed a website written in python (using django) on Microsoft Azure, and I have also bought a domain name from GoDaddy. I have already set the DNS record A of the domain I bought from GoDaddy to be the inbound IP address of my web application on Azure. But as I opened up the domain provided by GoDaddy, I found the page prompted a 404 error like below:404 Web Site not found.

You may be seeing this error due to one of the reasons listed below :

  • Custom domain has not been configured inside Azure. See how to map an existing domain to resolve this.
  • Client cache is still pointing the domain to old IP address. Clear the cache by running the command ipconfig/flushdns.

Checkout App Service Domain FAQ for more questions. How can I fix this?

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

2 answers

Sort by: Most helpful
  1. Sam Cogan 10,812 Reputation points Microsoft Employee Volunteer Moderator
    2024-01-17T08:46:15.9366667+00:00

    To have a domain name point to an app service in Azure, you need to do two things:

    1. Create an A record or CNAME to point to the app service - sounds like you have done this.
    2. Configure the app service to respond to this domain by adding a custom domain in the app service settings and validating it - the error indicates you have not done this.

    Follow the steps here to add a custom domain mapping to your app service.

    0 comments No comments

  2. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2024-01-22T12:19:18.6266667+00:00

    @Ke Li Based on the error message you received, it seems that the custom domain has not been configured inside Azure.

    Here are the steps you can follow to map your custom domain to your Azure Web App:

    1. In the Azure portal, go to your Web App and click on "Custom domains" under the "Settings" section.

    1. Click on "Add custom domain" and enter the domain name you purchased from GoDaddy.
    2. Click on "Validate" to verify that you own the domain. You will need to create a CNAME record in your GoDaddy DNS settings that points to your Azure Web App's default domain name.
    3. Once the domain ownership is verified, click on "Add hostname" to add the custom domain to your Web App.
    4. Finally, update the DNS record A of the domain you bought from GoDaddy to be the inbound IP address of your Azure Web App.

    After completing these steps, it may take some time for the DNS changes to propagate. Once the changes have propagated, you should be able to access your website using your custom domain name.

    If you have already completed these steps and are still experiencing issues, you can try clearing your client cache by running the command ipconfig/flushdns in the command prompt.

    Refer to: https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain?tabs=root%2Cazurecli

    If the issue persists, please let us know for further assistance.

    0 comments No comments

Your answer

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