Is it possible to disable the default URL assigned to the azure web app?

Copper Contributor
Is it possible to disable the default URL <webapp>.azurewebsites.net for a web app?
5 Replies

@PDDEV1 

 

I don't think you can turn off access to the website via [your cloud service name].azurewebsites.net domain.
However what you could do is include a rewrite rule in your web.config, so that whenever someone tries to access your website via azurewebsites.net domain, they are automatically redirected to your custom domain.

How to: Redirect the default *.azurewebsites.net domain to your custom domain on Azure Web Apps
https://www.zainrizvi.io/blog/block-default-azure-websites-domain/

Setup custom domain URL
https://docs.microsoftcommunitytraining.com/docs/setup-custom-domain-url

 

 

An App Service might be running in an App Service Environment though, and their default hostnames are different to .azurewebsites.net (see https://learn.microsoft.com/en-us/azure/app-service/environment/how-to-custom-domain-suffix), I believe you can even select your own domain suffix that replaces the one for the App Service Environment.

 

Additionally, App Services in Clouds other than the Global Cloud (GCC High, DoD, 21Vianet) use other domains than azurewebsites.net.

 

Thus, it is difficult to impossible to disable it for an existing Azure App Service, but if you are dealing with App Services in general, you should not assume that the domain always ends with .azurewebsites.net.

You cannot edit/update the default one but you can add custom domain names beside the ".azurewebsites.net"

@PDDEV1 

Seems not by default but handle by access restrictions