0

I want the url www.example.com to display default.html From this question I understand that the easiest way is still to create a web app.

[How not to do it]

I tried creating a solution in VS2017 File->New ->Project -> .Net Core -> Asp.Net Core Web Application-> Empty

Then I moved my static files into wwwroot and deployed What do I need to change so that default.html will load when someone goes to the site?

At the moment if I remove the Program class I get a message

Severity    Code    Description Project File    Line    Suppression State
Error   CS5001  Program does not contain a static 'Main' method suitable for an entry point 

which is understandable since it is a web application , how do I change it to be a static web site?

[A better way, create the app in Azure.]

Instead of the above method I created a new web app and followed the advise at this question to paste in index.html.

I can now go to the Azure url for the site and the correct content displays.

Next I need to get example.com to work.

I added the CName record for www in my DNS with the url for the site, and I also went to Custom Domains in Azure to add my domain name.

However I get the following error when I go to my site.

Error 404 - Web app not found.
The web app you have attempted to reach is not available in this Microsoft Azure App Service region. This could be due to one of several reasons:

1. The web app owner has registered a custom domain to point to the Microsoft Azure App Service, but has not yet configured Azure to recognize it. Click here to read more.

When an app owner wants to use a custom domain with a Microsoft Azure Web Apps web app, Azure needs to be configured to recognize the custom domain name, so that it can route the request to the appropriate server in the region. After registering the domain with a domain provider and configuring a DNS CNAME record to point to the app's Azurewebsites.net address (for example, contoso.azurewebsites.net), the web app owner also needs to go to the Azure Portal and configure the app for the new domain. Click here to learn more about configuring the custom domains for a web app.
Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • Following https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain – Kirsten Dec 19 '17 at 00:36
  • The trick is to keep going till you can see www.example.com and example.com listed under custom host names – Kirsten Dec 19 '17 at 00:49

1 Answers1

0

I got it working in the end. I must have missed a step in the documentation

Kirsten
  • 15,730
  • 41
  • 179
  • 318