Move Azure website between App Service Plans
Asked Answered
B

4

9

Is it possible to move an Azure Website to a different (or new) App Service Plan?

I have already tried both the old and new portals but cannot find the options for this.

Bibliographer answered 24/8, 2015 at 18:52 Comment(0)
C
8

The option "Change App Service plan" has been moved to the APP SERVICE PLAN menu. The new position is here

Calcify answered 24/10, 2016 at 1:37 Comment(2)
FYI, if you're not seeing your plan listed, it's probably because it's in a different Resource Group. You can only move between App Service Plans in the same Resource Group.Chevaldefrise
You can currently move to another plan if THREE conditions are met: The new plan must (1) exist in the same resource group, (2) exist in the same geographical region, and (3) exist in the same webspace (source). The first two conditions are straightforward, the third is hard to determine and impossible to change. Cloning is currently the only option if you still can't move to the plan you want to.Schaub
W
9

The original accepted answer is more than a year old. In Azure world, that's an eternity. The "Change App Plan" button in the Azure Portal is no longer present it appears (as of 2016-06-17), so I'm throwing in the Powershell command I needed to use in order to move a Webapp to another App Service Plan.

Set-AzureRmWebApp -Name <webapp name> -ResourceGroupName <resource group name> -AppServicePlan <new app service plan>
Set-AzureRmWebAppSlot -Name <webapp name> -Slot <slot name> -ResourceGroupName <resource group name> -AppServicePlan <new app service plan>
Wheelhouse answered 17/6, 2016 at 13:23 Comment(1)
Yep, the button doesn't seem to be present anymore.Melindamelinde
C
8

The option "Change App Service plan" has been moved to the APP SERVICE PLAN menu. The new position is here

Calcify answered 24/10, 2016 at 1:37 Comment(2)
FYI, if you're not seeing your plan listed, it's probably because it's in a different Resource Group. You can only move between App Service Plans in the same Resource Group.Chevaldefrise
You can currently move to another plan if THREE conditions are met: The new plan must (1) exist in the same resource group, (2) exist in the same geographical region, and (3) exist in the same webspace (source). The first two conditions are straightforward, the third is hard to determine and impossible to change. Cloning is currently the only option if you still can't move to the plan you want to.Schaub
H
7

Yes, you can do this from the Web app blade in the Azure portal. You have to expand the toolbar though to see the option. See below.

enter image description here

Hambley answered 24/8, 2015 at 19:11 Comment(1)
Totally missed the ellipsis. This does require that the Web Apps are in the same location and resource group.Bibliographer
B
2

I needed to move things between different subscriptions, which is quite possible according to documentation. Much is shamelessly copied from the azure website. This solution is taking advantage of the Azure Powershell 1.0.

First off, if you need to move a Web app and it's connected webfarm there are some limitations:

You can move Azure Web App resources using the ARM Move Resources Api.

Azure Web Apps currently supports the following move scenarios:

  • Moving the entire contents of a resource group (web apps, app service plans, and certificates) to another resource group.
    • Note: The destination resource group can not contain any Microsoft.Web resources in this scenario
  • Moving individual web apps to a different resource group, while still hosting them in their current app service plan (the app service plan stays in the old resource group)

Basically you need to get the resource id from the resources you want to move and use the Move-AzureRmResource command. You'll naturally need an Azure login which is able to read and write to the subscriptions involved.

$webapp = Get-AzureRmResource -ResourceGroupName OldGroup -ResourceName WebApp -ResourceType Microsoft.Web/sites

$plan = Get-AzureRmResource -ResourceGroupName OldGroup -ResourceName Plan -ResourceType Microsoft.Web/serverFarms

Move-AzureRmResource -DestinationResourceGroupName NewGroup -ResourceId ($webapp.ResourceId, $plan.ResourceId) -DestinationSubscriptionId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

I'd point out that if you're moving the resources to another subscription, there are some caveats. First, that subscription must have rights to provision the website in that region, the API's for that are beyond this scope, but simply creating a website and removing it will give the subscription those rights. In my case i had a second error which is still unresolved, but i suspect that other resources that are connected to the resources being moved are the culprits. Will update with further information if i resolve the issue.

As a final note, there is also the possibility to use the REST API.

Brainard answered 10/11, 2015 at 1:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.