Part 3 - All About Azure Resource group, Web API & App Service Plan : Change the resource group of a web app



This article is a part of 5 article series named All About Azure Resource group, Web API & App Service Plan, Important links for the series -

Part 1 - All About Azure Resource group, Web API & App Service Plan : Introduction

Part 2 - All About Azure Resource group, Web API & App Service Plan : Creating a web app in azure

Part 3 - All About Azure Resource group, Web API & App Service Plan : Change the resource group of a web app

Part 4 - All About Azure Resource group, Web API & App Service Plan : Change the App service plan of a Web App

Part 5 - All About Azure Resource group, Web API & App Service Plan : Move Subscription of a Web App

Part 6 - All About Azure Resource group, Web API & App Service Plan : Move Resource to a different Subscription (which is on a Different AAD).

Change the Resource group of a Web App 


Let's try to change the resource group of the web app which we create in part 2 of this article.

Deploymywindowsapp was the web app created, Notice there is a "Change" button next to resource group.

Click on the change button -

There are two settings that we need to take care of before changing the resource group for the web app, 

The first think is the app service plan (when you try to change the web app resource group, Azure will ask you if you want to change the resource group for other app associated services).

And the second things is a new resource group.

Here it's asking me for the app service plan. It will also ask you to select the resource group where you want to move the web app.



I will check the "select all" check box & create a new resource group.

Note - If there are other resources associated with the web app & in the same resource group. They will also appear under "Related resources to move".







After this Azure does a validation & will try to move the resource -


After validation the web app will be migrated to the new resource group, once the deployment is complete a notification will appear in the bell icon present in the top ribbon -


Other scenario's can be there like :-

Suppose you have an app called - app1
which is currently present in a resource group called - res1
and using an app service plan were the location is west us, subscription is xyz - asp1

You are trying to migrate aap1 to other resource group called - res2 this group already has a web app and an app service plan called asp2.

App1 can be migrated from res1 to res 2 if asp1 & asp2 (the app service plans) are having the same location & using the same subscription.

If there is a difference & you try to migrate the web app, you will get an error message like :-

Error Type
Resource move validation failed. Please see details. Diagnostic information: timestamp 'yyyymmddTxxxxxxx', subscription id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', tracking id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', request correlation id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'. (Code: ResourceMoveProviderValidationFailed)
Error Details
Cannot move resources because some serverfarm(s) are hosted by other resource group(s) but located in resource group 'Resource Group Name'. The list of serverfarms and corresponding hosting resource groups: '<App Service Plan : Resource Group>'. This may be a result of prior move operations. Move the serverfarm(s) back to respective hosting resource groups and try again. (Code: BadRequest, Target:Microsoft.Web/serverFarms)

No comments:

Post a Comment