Access webapp through hostfile entry

Jarrod 5 Reputation points
2023-04-24T05:12:48.71+00:00

how can I add a hostfile entry so I can access my webapp through domain? when I add a hostfile entry the page is azure 404 web site not found. I cant add a custom domain yet as it's still under development, the domain won't be made public on DNS until a later stage.

  • background - I have a deployed a website to a webapp. the website's usage license is attached to a domain address (example.com). Since my azure webapp is defaulted to *.azurewebsites.net. the usage license is invalid when I try to access the admin site through that address. Traditionally I would add a hostfile entry to so I can access the website through the licensed domain address and still land on the IP of the webapp.
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,970 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jarrod 5 Reputation points
    2023-04-26T23:51:23.6566667+00:00

    Turns out you can add a custom domain to azure and only need to validate with a TXT record leaving out the A record. This allowed me to then add a hostfile entry to the appservice IP address

    1 person found this answer helpful.

  2. Lex Li 6,037 Reputation points
    2023-04-24T14:04:09.7266667+00:00

    Technically, what you wished is impossible. You have to add the custom domain(s) to your Azure App Service instance, so that Azure knows how to route the HTTP requests to your instance, not any other's. Note that running things on Azure is completely different from running them on your own web server where you have full control, if that's what you meant by "traditionally".


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.