46
votes

For numerous time it has happened that our DevOps guys have created a Azure WebApp with incorrect URL.

Which forced us the delete the resource group (as group contains web app, sql azure etc.) And re-create.

Is there a way to re-name /update the Web App URL via powershell Azure API or some hidden azure portal feature?

5
Why are you deleting the whole resource group? You can just delete the webapp and recreate it in the same resource group with a different name.ahmelsayed
That's what we have been doing. I'm looking for an option to rename webapp URL.Nil Pun
What are down votes for? This is a legitimate question.Teoman shipahi
Can't rename Free WebApps. It is possible to add Host entry using Powershell to higher tier WebApps ...OzBob

5 Answers

33
votes

It's not possible to rename web apps.

And you don't need to delete the whole resource group. Just delete the one web app and recreate it with the correct name.

10
votes

You can clone the web app , and in the process give the new url. Remove the earlier web app and you are good to go

4
votes

You can just add the hostname to the resource hosting the web application.

For example from portal.azure.com go to "App Services", choose your service and from the blade search for "domain", then click "Custom domains", then add "hostname" that will ask your DNS, validate and give you the DNS records you need to add, see screenshot below:

Custom domains in Azure

NOTE: this does not actually rename the resource, the old one will still be a valid alias for the the resource along with the domain name registered in this note.

1
votes

No :(

Best option is to redeploy. Maybe add a confirmation message of your name? "Are you sure you want to call this resource 'Foobar'"?

0
votes

There is no way to rename your webapp url since it create unique dns and maps. If you still want to do that then use automation script to delete existing and redeploy your code to newly create one. Ex. Clone existing => update new url => create new webapp=> delete existing one