Nil Pun
Nil Pun

Reputation: 17383

How to rename the Azure WebApp URL

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?

Upvotes: 64

Views: 53331

Answers (6)

Sabyasachi Samaddar
Sabyasachi Samaddar

Reputation: 139

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

Note: "Clone app is a feature that is only available to apps hosted on Premium App Service Plans. You can upgrade your App Service Plan to get access to this feature."

Upvotes: 13

Rick B
Rick B

Reputation: 13

I came here for the same reason for my dev site and just gave up and cloned it since it was dev\qc anyway. Took about 5-7 minutes to clone and BOOM, no changes needed and actually was able to update the region to a better one\closer to have a better compare to my prod.

Under Azure App Home page for your app., scroll down on left to "Developer tools" - Select Clone app. Add a new URL and update area etc.

You can then go and add your custom domain after, etc.

Simple as that..

Upvotes: 1

Rahul Shukla
Rahul Shukla

Reputation: 716

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

Upvotes: 1

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.

Upvotes: 8

Zain Rizvi
Zain Rizvi

Reputation: 24656

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.

Upvotes: 39

Chris Anderson
Chris Anderson

Reputation: 8515

No :(

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

Upvotes: 1

Related Questions